diff options
Diffstat (limited to 'loslib.c')
-rw-r--r-- | loslib.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loslib.c,v 1.44 2014/03/12 20:57:40 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.45 2014/03/20 19:18:54 roberto Exp roberto $ |
3 | ** Standard Operating System library | 3 | ** Standard Operating System library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -59,9 +59,15 @@ | |||
59 | #if defined(LUA_USE_POSIX) /* { */ | 59 | #if defined(LUA_USE_POSIX) /* { */ |
60 | 60 | ||
61 | #include <unistd.h> | 61 | #include <unistd.h> |
62 | |||
62 | #define LUA_TMPNAMBUFSIZE 32 | 63 | #define LUA_TMPNAMBUFSIZE 32 |
64 | |||
65 | #if !defined(LUA_TMPNAMTEMPLATE) | ||
66 | #define LUA_TMPNAMTEMPLATE "/tmp/lua_XXXXXX" | ||
67 | #endif | ||
68 | |||
63 | #define lua_tmpnam(b,e) { \ | 69 | #define lua_tmpnam(b,e) { \ |
64 | strcpy(b, "/tmp/lua_XXXXXX"); \ | 70 | strcpy(b, LUA_TMPNAMTEMPLATE); \ |
65 | e = mkstemp(b); \ | 71 | e = mkstemp(b); \ |
66 | if (e != -1) close(e); \ | 72 | if (e != -1) close(e); \ |
67 | e = (e == -1); } | 73 | e = (e == -1); } |