Browse Source

although an ANSI function, some systems do not offer "strerror"

Roberto Ierusalimschy 29 years ago
parent
commit
389e808c60
1 changed files with 4 additions and 0 deletions
  1. 4 0
      iolib.c

+ 4 - 0
iolib.c

@@ -28,7 +28,11 @@ static void pushresult (int i)
     lua_pushuserdata(NULL);
     lua_pushuserdata(NULL);
   else {
   else {
     lua_pushnil();
     lua_pushnil();
+#ifndef NOSTRERROR
     lua_pushstring(strerror(errno));
     lua_pushstring(strerror(errno));
+#else
+    lua_pushstring("system unable to define the error");
+#endif
   }
   }
 }
 }