aboutsummaryrefslogtreecommitdiffstats
path: root/community/hermes/Utils.cpp.patch
blob: d5b5c16354f587bcb282054ad89c171201db07b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- hermes-1.9/src/Utils.cpp
+++ ../Utils.cpp.modified
@@ -418,9 +418,15 @@
 {
   char buf[2048]="";
   char *strerr;
-//  if(strerror_r(errnum,strerr,1024)!=-1)
   #ifndef WIN32
+  #ifdef __GLIBC__
   strerr=strerror_r(errnum,buf,2048);
+  #else
+  int retval = strerror_r(errnum, buf, sizeof buf);
+  strerr = buf;
+  if(retval != 0)
+     strcpy(buf, "error fetching error description");
+  #endif
   #else
   strerr="Error ";
   #endif //WIN32