Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 224483 | Differences between
and this patch

Collapse All | Expand All

(-)coreutils-6.12-orig/lib/utimens.c (+22 lines)
Lines 103-108 gl_futimens (int fd ATTRIBUTE_UNUSED, Link Here
103
  if (fd < 0)
103
  if (fd < 0)
104
    {
104
    {
105
      int result = utimensat (AT_FDCWD, file, timespec, 0);
105
      int result = utimensat (AT_FDCWD, file, timespec, 0);
106
# ifdef __linux__
107
       /* Work around what might be a kernel bug:
108
        http://bugzilla.redhat.com/442352
109
        http://bugzilla.redhat.com/449910
110
        It appears that utimensat can mistakenly return 280 rather
111
        than 0 to indicate success.
112
        FIXME: remove in 2010 or whenever the offending kernels
113
        are no longer in common use.  */
114
       if (0 < result)
115
         errno = ENOSYS;
116
# endif
106
      if (result == 0 || errno != ENOSYS)
117
      if (result == 0 || errno != ENOSYS)
107
        return result;
118
        return result;
108
    }
119
    }
Lines 110-115 gl_futimens (int fd ATTRIBUTE_UNUSED, Link Here
110
#if HAVE_FUTIMENS
121
#if HAVE_FUTIMENS
111
  {
122
  {
112
    int result = futimens (fd, timespec);
123
    int result = futimens (fd, timespec);
124
# ifdef __linux__
125
       /* Work around what might be a kernel bug:
126
        http://bugzilla.redhat.com/442352
127
        http://bugzilla.redhat.com/449910
128
        It appears that utimens can mistakenly return 280 rather
129
        than 0 to indicate success.
130
        FIXME: remove in 2010 or whenever the offending kernels
131
        are no longer in common use.  */
132
    if (0 < result)
133
       errno = ENOSYS;
134
# endif
113
    if (result == 0 || errno != ENOSYS)
135
    if (result == 0 || errno != ENOSYS)
114
      return result;
136
      return result;
115
  }
137
  }
(-)coreutils-6.12-orig/tests/Makefile.am (+1 lines)
Lines 215-220 TESTS = \ Link Here
215
  misc/tty-eof					\
215
  misc/tty-eof					\
216
  misc/unexpand					\
216
  misc/unexpand					\
217
  misc/uniq					\
217
  misc/uniq					\
218
  misc/utimensat-touchcp  \
218
  chmod/c-option				\
219
  chmod/c-option				\
219
  chmod/equal-x					\
220
  chmod/equal-x					\
220
  chmod/equals					\
221
  chmod/equals					\
(-)coreutils-6.12-orig/tests/misc/utimensat-touchcp (+33 lines)
Line 0 Link Here
1
#!/bin/sh
2
# Make sure touch -r and cp -pr works without hanging.
3
4
if test "$VERBOSE" = yes; then
5
  set -x
6
  touch --version
7
  cp --version
8
fi
9
10
. $srcdir/test-lib.sh
11
12
touch a.old || framework_failure
13
sleep 1
14
15
fail=0
16
17
#check for touch
18
touch -r a.old a || fail=1
19
ls -l --full-time a >time1
20
ls -l --full-time a.old >time2
21
sed -i 's/a.old/a/' time2
22
cmp time1 time2 > /dev/null 2>&1 || fail=1
23
test $fail = 1 && diff time1 time2 2> /dev/null
24
25
#check for cp
26
cp -pr a.old b || fail=1
27
ls -l --full-time a >time1
28
ls -l --full-time a.old >time2
29
sed -i 's/a.old/a/' time2
30
cmp time1 time2 > /dev/null 2>&1 || fail=1
31
test $fail = 1 && diff time1 time2 2> /dev/null
32
33
(exit $fail); exit $fail

Return to bug 224483