diff --git a/src/modules/system/system.c b/src/modules/system/system.c index 1e71cce990d4f5b641ff8afadeb142d281a16bcf..293bd47aae6cd60e321e5178c129d267d63222e4 100644 --- a/src/modules/system/system.c +++ b/src/modules/system/system.c @@ -1,5 +1,5 @@ /* - * $Id: system.c,v 1.68 1999/04/16 15:08:13 grubba Exp $ + * $Id: system.c,v 1.69 1999/04/16 20:40:57 grubba Exp $ * * System-call module for Pike * @@ -15,7 +15,7 @@ #include "system_machine.h" #include "system.h" -RCSID("$Id: system.c,v 1.68 1999/04/16 15:08:13 grubba Exp $"); +RCSID("$Id: system.c,v 1.69 1999/04/16 20:40:57 grubba Exp $"); #ifdef HAVE_WINSOCK_H #include <winsock.h> #endif @@ -511,6 +511,7 @@ void f_getgroups(INT32 args) #ifdef HAVE_SETUID void f_setuid(INT32 args) { + int err; INT32 id; #ifdef PIKE_SECURITY @@ -527,9 +528,9 @@ void f_setuid(INT32 args) id = sp[-args].u.integer; } - /* FIXME: Check return-code */ - setuid(id); - pop_n_elems(args-1); + err = setuid(id); + pop_n_elems(args); + push_int(err); } #endif @@ -1083,7 +1084,7 @@ void pike_module_init(void) #ifdef HAVE_SETUID /* function(int:void) */ - ADD_EFUN("setuid", f_setuid,tFunc(tInt,tVoid), OPT_SIDE_EFFECT); + ADD_EFUN("setuid", f_setuid,tFunc(tInt,tInt), OPT_SIDE_EFFECT); #endif #ifdef HAVE_SETGID