From 1bfddfe8aee556ded8f302e00801e85de66682ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Wed, 14 Apr 1999 21:17:21 -0700
Subject: [PATCH] bugfix

Rev: src/modules/system/system.c:1.61
---
 src/modules/system/system.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/modules/system/system.c b/src/modules/system/system.c
index a1a0c26615..21b9d1eddc 100644
--- a/src/modules/system/system.c
+++ b/src/modules/system/system.c
@@ -1,5 +1,5 @@
 /*
- * $Id: system.c,v 1.60 1998/08/06 05:31:51 hubbe Exp $
+ * $Id: system.c,v 1.61 1999/04/15 04:17:21 hubbe Exp $
  *
  * System-call module for Pike
  *
@@ -15,7 +15,7 @@
 #include "system_machine.h"
 #include "system.h"
 
-RCSID("$Id: system.c,v 1.60 1998/08/06 05:31:51 hubbe Exp $");
+RCSID("$Id: system.c,v 1.61 1999/04/15 04:17:21 hubbe Exp $");
 #ifdef HAVE_WINSOCK_H
 #include <winsock.h>
 #endif
@@ -476,7 +476,7 @@ void f_setuid(INT32 args)
 #ifdef HAVE_SETGID
 void f_setgid(INT32 args)
 {
-  int id;
+  int id,err;
 
   get_all_args("setgid", args, "%i", &id);
  
@@ -488,8 +488,9 @@ void f_setgid(INT32 args)
   }
 
   /* FIXME: Check return-code */
-  setgid(id);
-  pop_n_elems(args-1);
+  err=setgid(id);
+  pop_n_elems(args);
+  push_int(err);
 }
 #endif
 
-- 
GitLab