]> granicus.if.org Git - cronie/commitdiff
fix of bug rhbz#154065: crontab should not use waitpid(...,WUNTRACED)
authormmaslano <mmaslano@redhat.com>
Fri, 17 Aug 2007 13:04:18 +0000 (15:04 +0200)
committermmaslano <mmaslano@redhat.com>
Fri, 24 Aug 2007 13:05:59 +0000 (15:05 +0200)
and stop itself if its child is stopped

crontab.c

index ce2af91878dbbd2a34bd8ddb2538e383c1140209..3662b462cca2dcbc6319e0f81e0a51b804f79941 100644 (file)
--- a/crontab.c
+++ b/crontab.c
@@ -463,7 +463,7 @@ edit_cmd(void) {
 
        /* parent */
        for (;;) {
-               xpid = waitpid(pid, &waiter, WUNTRACED);
+               xpid = waitpid(pid, &waiter, 0);
                if (xpid == -1) {
                        if (errno != EINTR)
                                fprintf(stderr, "%s: waitpid() failed waiting for PID %ld from \"%s\": %s\n",
@@ -472,8 +472,6 @@ edit_cmd(void) {
                        fprintf(stderr, "%s: wrong PID (%ld != %ld) from \"%s\"\n",
                                ProgramName, (long)xpid, (long)pid, editor);
                        goto fatal;
-               } else if (WIFSTOPPED(waiter)) {
-                       kill(getpid(), WSTOPSIG(waiter));
                } else if (WIFEXITED(waiter) && WEXITSTATUS(waiter)) {
                        fprintf(stderr, "%s: \"%s\" exited with status %d\n",
                                ProgramName, editor, WEXITSTATUS(waiter));