From: Sami Kerola Date: Sat, 24 Nov 2012 19:09:38 +0000 (+0000) Subject: declarations: fix shadow declarations X-Git-Tag: cronie1.4.10~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05c4a1a4cc4025f379fcb2272bfeebd4b642ba4c;p=cronie declarations: fix shadow declarations 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 --- diff --git a/src/do_command.c b/src/do_command.c index bde800f..d1c834a 100644 --- a/src/do_command.c +++ b/src/do_command.c @@ -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")) diff --git a/src/user.c b/src/user.c index 9b11d01..6c63c18 100644 --- a/src/user.c +++ b/src/user.c @@ -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);