Giuseppe Scrivano wrote: > Hi, > > I cleaned a bit the Pádraig's example in a new test case. > > The second patch fixes a problem that I introduced with the commit > e81c4d88c2fce526c02693d539e22c7468dc452b.
Thanks for the test. We should be able to use it regardless of whether the feature is added to cp or ln. However, please arrange to clean up (unmount) not just on normal completion, but also when e.g., interrupted. Note how that is done in the other tests that mount/unmount file systems. Here's one example: cp/cp-a-selinux:cleanup_() { cd /; umount "$cwd/mnt"; } >>From 0348010828d201c0790c06e1427cc4b813c605db Mon Sep 17 00:00:00 2001 > From: Giuseppe Scrivano <gscriv...@gnu.org> > Date: Wed, 29 Jul 2009 20:57:29 +0200 > Subject: [PATCH 2/2] tail: exit successfully on watched process death > > * src/tail.c (tail_forever_inotify): If a PID is specified and the > watched process is death, exit with an EXIT_SUCCESS code. > --- > src/tail.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/tail.c b/src/tail.c > index a73ffa2..5efaf57 100644 > --- a/src/tail.c > +++ b/src/tail.c > @@ -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; > } Thanks! I've added a test for this, too: >From 2ac2cace153dd19aaff5d3e0e6ce68d03146ca92 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Thu, 30 Jul 2009 10:27:51 +0200 Subject: [PATCH] tests: test for just-fixed tail --pid bug * tests/tail-2/pid: Ensure tail exits successfully when PID dies. --- tests/tail-2/pid | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tests/tail-2/pid b/tests/tail-2/pid index 9d33e4f..446c6db 100755 --- a/tests/tail-2/pid +++ b/tests/tail-2/pid @@ -65,4 +65,9 @@ if test -n "$state"; then kill $pid fi +# Ensure that tail --pid=PID exits successfully when PID is dead. +# Use an unlikely-to-be-live PID: 2^31-1 +getlimits_ +tail --pid=$INT_MAX -f /dev/null || fail=1 + Exit $fail -- 1.6.4.rc3.201.gd9d59 _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils