]> granicus.if.org Git - cronie/commitdiff
declarations: fix shadow declarations
authorSami Kerola <kerolasa@iki.fi>
Sat, 24 Nov 2012 19:09:38 +0000 (19:09 +0000)
committerTomas Mraz <tmraz@fedoraproject.org>
Mon, 26 Nov 2012 16:25:11 +0000 (17:25 +0100)
user.c:68:7: warning: declaration of 'save_errno' shadows a previous local [-Wshadow]
user.c:64:14: warning: shadowed declaration is here [-Wshadow]

do_command.c:559:9: warning: declaration of 'pid' shadows a previous local [-Wshadow]
do_command.c:91:8: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
src/do_command.c
src/user.c

index bde800ff83ca1c33b2e3df546730c33df495e08e..d1c834a37be3aa530e868ff8d9392a73017224dc 100644 (file)
@@ -555,19 +555,19 @@ static int child_process(entry * e, char **jobenv) {
         */
        for (; children > 0; children--) {
                WAIT_T waiter;
-               PID_T pid;
+               PID_T child;
 
                Debug(DPROC, ("[%ld] waiting for grandchild #%d to finish\n",
                                (long) getpid(), children))
-                       while ((pid = wait(&waiter)) < OK && errno == EINTR) ;
-               if (pid < OK) {
+                       while ((child = wait(&waiter)) < OK && errno == EINTR) ;
+               if (child < OK) {
                        Debug(DPROC,
                                ("[%ld] no more grandchildren--mail written?\n",
                                        (long) getpid()))
                                break;
                }
                Debug(DPROC, ("[%ld] grandchild #%ld finished, status=%04x",
-                               (long) getpid(), (long) pid, WEXITSTATUS(waiter)))
+                               (long) getpid(), (long) child, WEXITSTATUS(waiter)))
                        if (WIFSIGNALED(waiter) && WCOREDUMP(waiter))
                        Debug(DPROC, (", dumped core"))
                                Debug(DPROC, ("\n"))
index 9b11d01dbf82890aad01b2fe56f7a7f38cb804ca..6c63c180a6b01c0e9e2f1087436d000e2b2f302d 100644 (file)
@@ -67,7 +67,7 @@ load_user (int crontab_fd, struct passwd *pw, const char *uname,
        char **envp = NULL, **tenvp;
 
        if (!(file = fdopen(crontab_fd, "r")))  {
-               int save_errno = errno;
+               save_errno = errno;
                log_it(uname, getpid (), "FAILED", "fdopen on crontab_fd in load_user",
                        save_errno);
                close(crontab_fd);