Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37532371
en ru br
Репозитории ALT
S:0.1.6734.fbd3f-alt1
www.altlinux.org/Changes

Группа :: Разработка/C
Пакет: gnulib

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: gnulib-alt-utimens.patch
Скачать


From 3346754d91ba27616e7f50dc7ce32a0e1751a0d1 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Wed, 24 Jun 2009 22:39:03 +0000
Subject: [PATCH] lib/utimens.c (fdutimens, lutimens): Workaround OpenVZ kernel bug #970
http://bugzilla.openvz.org/show_bug.cgi?id=970
diff --git a/lib/utimens.c b/lib/utimens.c
index f6c4fe34c..b45cb1b8a 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -253,9 +253,11 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
              https://bugzilla.redhat.com/show_bug.cgi?id=449910
              It appears that utimensat can mistakenly return 280 rather
              than -1 upon ENOSYS failure.
+             Also, Work around an OpenVZ kernel bug:
+             http://bugzilla.openvz.org/show_bug.cgi?id=970
              FIXME: remove in 2010 or whenever the offending kernels
              are no longer in common use.  */
-          if (0 < result)
+          if (0 < result || (result < 0 && errno == EFAULT))
             errno = ENOSYS;
 #  endif /* __linux__ */
           if (result == 0 || errno != ENOSYS)
@@ -271,7 +273,7 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
           result = futimens (fd, ts);
 #  ifdef __linux__
           /* Work around the same bug as above.  */
-          if (0 < result)
+          if (0 < result || (result < 0 && errno == EFAULT))
             errno = ENOSYS;
 #  endif /* __linux__ */
           if (result == 0 || errno != ENOSYS)
@@ -571,7 +573,7 @@ lutimens (char const *file, struct timespec const timespec[2])
          than -1 upon ENOSYS failure.
          FIXME: remove in 2010 or whenever the offending kernels
          are no longer in common use.  */
-      if (0 < result)
+      if (0 < result || (result < 0 && errno == EFAULT))
         errno = ENOSYS;
 # endif
       if (result == 0 || errno != ENOSYS)
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin