]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tail: exit successfully upon watched process death
authorGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 29 Jul 2009 18:57:29 +0000 (20:57 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 30 Jul 2009 08:24:17 +0000 (10:24 +0200)
* src/tail.c (tail_forever_inotify): If a PID is specified and the
watched process dies, exit with status EXIT_SUCCESS, rather than
falling through to an EXIT_FAILURE.

src/tail.c

index a73ffa25df6369c72a66b62edd9e1f83df25c746..5efaf57d98430e2f9a86f345f6b181ac53f72171 100644 (file)
@@ -1280,7 +1280,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t n_files,
             {
               /* See if the process we are monitoring is still alive.  */
               if (kill (pid, 0) != 0 && errno != EPERM)
-                break;
+                exit (EXIT_SUCCESS);
 
               continue;
             }