2014-09-02 23:17:18 +02:00
|
|
|
Date: 2014-08-13 15:39:48.523887951 +0200
|
|
|
|
From: Jan Engelhardt <jengelh@inai.de>
|
|
|
|
|
|
|
|
Error messages are totally useless without the actual error cause!
|
|
|
|
---
|
2017-04-27 22:08:39 +02:00
|
|
|
source/tools/toolutil/package.cpp | 5 +++--
|
|
|
|
source/tools/toolutil/writesrc.cpp | 6 ++++--
|
2014-09-02 23:17:18 +02:00
|
|
|
2 files changed, 7 insertions(+), 4 deletions(-)
|
|
|
|
|
|
|
|
Index: icu/source/tools/toolutil/package.cpp
|
|
|
|
===================================================================
|
|
|
|
--- icu.orig/source/tools/toolutil/package.cpp
|
|
|
|
+++ icu/source/tools/toolutil/package.cpp
|
2016-12-10 16:27:45 +01:00
|
|
|
@@ -35,6 +35,7 @@
|
2014-09-02 23:17:18 +02:00
|
|
|
#include "package.h"
|
|
|
|
#include "cmemory.h"
|
|
|
|
|
|
|
|
+#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2016-12-10 16:27:45 +01:00
|
|
|
@@ -748,7 +749,7 @@ Package::writePackage(const char *filena
|
2014-09-02 23:17:18 +02:00
|
|
|
// create the file and write its contents
|
|
|
|
file=fopen(filename, "wb");
|
2023-04-14 01:09:54 +02:00
|
|
|
if(file==nullptr) {
|
2014-09-02 23:17:18 +02:00
|
|
|
- fprintf(stderr, "icupkg: unable to create file \"%s\"\n", filename);
|
|
|
|
+ fprintf(stderr, "icupkg: unable to create file \"%s\": %s\n", filename, strerror(errno));
|
|
|
|
exit(U_FILE_ACCESS_ERROR);
|
|
|
|
}
|
|
|
|
|
2016-12-10 16:27:45 +01:00
|
|
|
@@ -1169,7 +1170,7 @@ Package::extractItem(const char *filesPa
|
2014-09-02 23:17:18 +02:00
|
|
|
makeFullFilenameAndDirs(filesPath, outName, filename, (int32_t)sizeof(filename));
|
|
|
|
file=fopen(filename, "wb");
|
2023-04-14 01:09:54 +02:00
|
|
|
if(file==nullptr) {
|
2014-09-02 23:17:18 +02:00
|
|
|
- fprintf(stderr, "icupkg: unable to create file \"%s\"\n", filename);
|
|
|
|
+ fprintf(stderr, "icupkg: unable to create file \"%s\": %s\n", filename, strerror(errno));
|
|
|
|
exit(U_FILE_ACCESS_ERROR);
|
|
|
|
}
|
|
|
|
fileLength=(int32_t)fwrite(pItem->data, 1, pItem->length, file);
|
2017-04-27 22:08:39 +02:00
|
|
|
Index: icu/source/tools/toolutil/writesrc.cpp
|
2014-09-02 23:17:18 +02:00
|
|
|
===================================================================
|
2017-04-27 22:08:39 +02:00
|
|
|
--- icu.orig/source/tools/toolutil/writesrc.cpp
|
|
|
|
+++ icu/source/tools/toolutil/writesrc.cpp
|
2016-12-10 16:27:45 +01:00
|
|
|
@@ -18,7 +18,9 @@
|
2014-09-02 23:17:18 +02:00
|
|
|
* Helper functions for writing source code for data.
|
|
|
|
*/
|
|
|
|
|
|
|
|
+#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
+#include <string.h>
|
|
|
|
#include <time.h>
|
2023-04-14 01:09:54 +02:00
|
|
|
|
|
|
|
// The C99 standard suggested that C++ implementations not define PRId64 etc. constants
|
|
|
|
@@ -75,8 +77,8 @@ usrc_createWithoutHeader(const char *pat
|
|
|
|
if (f==nullptr) {
|
2014-09-02 23:17:18 +02:00
|
|
|
fprintf(
|
|
|
|
stderr,
|
|
|
|
- "usrc_create(%s, %s): unable to create file\n",
|
2023-04-14 01:09:54 +02:00
|
|
|
- path!=nullptr ? path : "", filename);
|
2014-09-02 23:17:18 +02:00
|
|
|
+ "usrc_create(%s, %s): unable to create file: %s\n",
|
2023-04-14 01:09:54 +02:00
|
|
|
+ path!=nullptr ? path : "", filename, strerror(errno));
|
2014-09-02 23:17:18 +02:00
|
|
|
}
|
|
|
|
return f;
|
|
|
|
}
|