浏览代码

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

Roberto Ierusalimschy 29 年之前
父节点
当前提交
389e808c60
共有 1 个文件被更改,包括 4 次插入0 次删除
  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
   }
   }
 }
 }