From 0b85837cb06280a18abf40b95a366ccaeb02ed2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Fri, 16 Apr 1999 22:40:57 +0200
Subject: [PATCH] Fixed some more droppings bugs.

Rev: src/modules/system/system.c:1.69
---
 src/modules/system/system.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/modules/system/system.c b/src/modules/system/system.c
index 1e71cce990..293bd47aae 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
   
-- 
GitLab