Eric Blake wrote: > According to Eric Blake on 1/8/2010 11:55 AM: >> >> So it seems like this would do the trick (but I have not yet tested it on >> a system with the mismatch between kernel and glibc, so no ChangeLog yet...) > > OK to apply before 8.4? > > -- > Don't work too hard, make some time for fun as well! > > Eric Blake [email protected] > From ee6deaa7bc90b26efcc1d23c8b99900d0c027fcc Mon Sep 17 00:00:00 2001 > From: Eric Blake <[email protected]> > Date: Fri, 8 Jan 2010 12:01:08 -0700 > Subject: [PATCH] tests: avoid spurious failure on old kernel > > * tests/touch/no-dereference: Skip test if utimensat doesn't > support symlinks. > Reported by Bernhard Voelker. > --- > tests/touch/no-dereference | 13 +++++++++++-- > 1 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/tests/touch/no-dereference b/tests/touch/no-dereference > index 7adacc4..c1a6748 100755 > --- a/tests/touch/no-dereference > +++ b/tests/touch/no-dereference > @@ -48,8 +48,17 @@ grep '^#define HAVE_LUTIMES' "$CONFIG_HEADER" > /dev/null > || > skip_test_ 'this system lacks the utimensat function' > > # Changing time of dangling symlink is okay. > -touch -h dangling || fail=1 > -test -f nowhere && fail=1 > +# Skip the test if this fails, but the error text corresponds to > +# ENOSYS (possible with old kernel but new glibc). > +touch -h dangling 2> err > +case $? in > + 0) test -f nowhere && fail=1 > + test -s err && fail=1;; > + 1) grep 'Function not implemented' err \ > + && skip_test_ 'this system lacks the utimensat function' > + fail=1;;
But isn't the above fail=1 is unreachable code, since skip_test_ exits? > + *) fail=1;; > +esac > > # Change the mtime of a symlink. > touch -m -h -d 2009-10-10 link || fail=1
