Author: sparky                       Date: Mon Jan 31 19:48:15 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- cosmetics and small fixes

---- Files affected:
packages/rc-scripts-user:
   run-fast-or-hide.c (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: packages/rc-scripts-user/run-fast-or-hide.c
diff -u packages/rc-scripts-user/run-fast-or-hide.c:1.2 
packages/rc-scripts-user/run-fast-or-hide.c:1.3
--- packages/rc-scripts-user/run-fast-or-hide.c:1.2     Mon Jan 31 20:05:05 2011
+++ packages/rc-scripts-user/run-fast-or-hide.c Mon Jan 31 20:48:10 2011
@@ -30,6 +30,13 @@
 static pid_t our_child = 0;
 
 static void
+die( const char *msg )
+{
+       fprintf(stderr, "ERROR: %s\n", msg);
+       exit( 127 );
+}
+
+static void
 cb_sigchld( int signum )
 {
        int status;
@@ -79,7 +86,7 @@
        return;
 }
 
-int
+static int
 run_child( int verbose, struct passwd *pw, int nicelevel, char * const *argv )
 {
        if ( nicelevel )
@@ -87,13 +94,13 @@
 
        if ( pw != NULL ) {
                if ( setgid( pw->pw_gid ) )
-                       exit( 1 );
+                       die( "cannot set gid" );
                if ( initgroups( pw->pw_name, pw->pw_gid ) )
-                       exit( 1 );
+                       die( "cannot init group list" );
                if ( setuid( pw->pw_uid ) )
-                       exit( 1 );
+                       die( "cannot set uid" );
                if ( chdir( pw->pw_dir ) )
-                       exit( 1 );
+                       die( "cannot change directory" );
        }
 
        if ( ! verbose ) {
@@ -107,14 +114,7 @@
        return 127;
 }
 
-void
-die( const char *msg )
-{
-       fprintf(stderr, "ERROR: %s\n", msg);
-       exit( 127 );
-}
-
-void
+static void
 show_help( void )
 {
        printf(
@@ -154,7 +154,7 @@
                { "sleep",        1, NULL, 's' },
                { "user",         1, NULL, 'u' },
                { "nice",         1, NULL, 'n' },
-               { "quiet",        0, NULL, 'q' },
+               { "verbose",      0, NULL, 'v' },
                { NULL,         0, NULL, 0 }
        };
 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rc-scripts-user/run-fast-or-hide.c?r1=1.2&r2=1.3&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to