Re: shadow fails to compile with gcc-2

Mike Frysinger <[email protected]> Sun, 4 Sep 2005 14:06:16 -0400
Newsgroups gmane.linux.pld.shadow.general
Organization wh0rd.org
Message-ID <[email protected]>
On Sunday 04 September 2005 09:33 am, Tomasz Kłoczko wrote:
> On Sat, 3 Sep 2005, Mike Frysinger wrote:
> > src/newgrp.c declares some variables in the middle of scope and gcc-2
> > rejects this ... the child/pid variables could either be moved up to the
> > top of the if scope, or the USE_PAM code could be given a local scope ...
> > ive attached a patch by Martin Schlemmer for the former behavior
>
> but understand
> also me: I want keep shadow code in best readable form.
> Current form in this area is IMO better.

yeah, the current form is def more readable than the version the previous 
patch changed it to

how about this patch instead ?
-mike
shadow-newgrp-gcc2.patch (text/x-diff, 721 B)
Index: src/newgrp.c
===================================================================
RCS file: /cvsroot/shadow/src/newgrp.c,v
retrieving revision 1.40
diff -u -p -r1.40 newgrp.c
--- src/newgrp.c	31 Aug 2005 17:25:00 -0000	1.40
+++ src/newgrp.c	4 Sep 2005 18:04:30 -0000
@@ -459,6 +459,7 @@ int main (int argc, char **argv)
 		 * avoid any possibility of the parent being stopped when it
 		 * receives SIGCHLD from the terminating subshell.  -- JWP
 		 */
+		{
 		pid_t child, pid;
 
 		signal (SIGINT, SIG_IGN);
@@ -502,6 +503,7 @@ int main (int argc, char **argv)
 		signal (SIGTSTP, SIG_DFL);
 		signal (SIGTTIN, SIG_DFL);
 		signal (SIGTTOU, SIG_DFL);
+		}
 #endif				/* USE_PAM */
 	}
 #endif				/* USE_SYSLOG */