From d3a6d95b9af04359c77aed1eed39615b56141356 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 18 Mar 2005 15:02:04 -0300 Subject: more cleaning on configurations --- loslib.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'loslib.c') diff --git a/loslib.c b/loslib.c index 728ee1d8..034acd5f 100644 --- a/loslib.c +++ b/loslib.c @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.5 2005/03/08 20:10:05 roberto Exp roberto $ +** $Id: loslib.c,v 1.6 2005/03/09 16:28:07 roberto Exp roberto $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -57,16 +57,13 @@ static int io_rename (lua_State *L) { static int io_tmpname (lua_State *L) { -#if !LUA_USE_TMPNAME - luaL_error(L, "`tmpname' not supported"); - return 0; -#else - char buff[L_tmpnam]; - if (tmpnam(buff) != buff) - return luaL_error(L, "unable to generate a unique filename in `tmpname'"); + char buff[LUA_TMPNAMBUFSIZE]; + int err; + lua_tmpnam(buff, err); + if (err) + return luaL_error(L, "unable to generate a unique filename"); lua_pushstring(L, buff); return 1; -#endif } -- cgit v1.2.3-55-g6feb