summaryrefslogtreecommitdiff
path: root/loslib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-03-18 15:02:04 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-03-18 15:02:04 -0300
commitd3a6d95b9af04359c77aed1eed39615b56141356 (patch)
treeabde9a939eddd0e8338e28427036360459d6a9eb /loslib.c
parent47984a0cc2aae6a806d9d831f2393340a1df676a (diff)
downloadlua-d3a6d95b9af04359c77aed1eed39615b56141356.tar.gz
lua-d3a6d95b9af04359c77aed1eed39615b56141356.tar.bz2
lua-d3a6d95b9af04359c77aed1eed39615b56141356.zip
more cleaning on configurations
Diffstat (limited to 'loslib.c')
-rw-r--r--loslib.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/loslib.c b/loslib.c
index 728ee1d8..034acd5f 100644
--- a/loslib.c
+++ b/loslib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loslib.c,v 1.5 2005/03/08 20:10:05 roberto Exp roberto $ 2** $Id: loslib.c,v 1.6 2005/03/09 16:28:07 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*/
@@ -57,16 +57,13 @@ static int io_rename (lua_State *L) {
57 57
58 58
59static int io_tmpname (lua_State *L) { 59static int io_tmpname (lua_State *L) {
60#if !LUA_USE_TMPNAME 60 char buff[LUA_TMPNAMBUFSIZE];
61 luaL_error(L, "`tmpname' not supported"); 61 int err;
62 return 0; 62 lua_tmpnam(buff, err);
63#else 63 if (err)
64 char buff[L_tmpnam]; 64 return luaL_error(L, "unable to generate a unique filename");
65 if (tmpnam(buff) != buff)
66 return luaL_error(L, "unable to generate a unique filename in `tmpname'");
67 lua_pushstring(L, buff); 65 lua_pushstring(L, buff);
68 return 1; 66 return 1;
69#endif
70} 67}
71 68
72 69