Comparison

util-src/pposix.c @ 3482:e1a4f7b15caf

util.pposix: uname(): Fix to push nil,err in case of error
author Matthew Wild <mwild1@gmail.com>
date Tue, 31 Aug 2010 15:23:41 +0100
parent 3481:72d3c8029178
child 3966:e71c19dac1c7
comparison
equal deleted inserted replaced
3481:72d3c8029178 3482:e1a4f7b15caf
557 int lc_uname(lua_State* L) 557 int lc_uname(lua_State* L)
558 { 558 {
559 struct utsname uname_info; 559 struct utsname uname_info;
560 if(uname(&uname_info) != 0) 560 if(uname(&uname_info) != 0)
561 { 561 {
562 lua_pushnil(L);
562 lua_pushstring(L, strerror(errno)); 563 lua_pushstring(L, strerror(errno));
563 return 2; 564 return 2;
564 } 565 }
565 lua_newtable(L); 566 lua_newtable(L);
566 lua_pushstring(L, uname_info.sysname); 567 lua_pushstring(L, uname_info.sysname);