]> git.ipfire.org Git - thirdparty/make.git/commitdiff
(name_mtime): Use safe_stat in place of stat.
authorRoland McGrath <roland@redhat.com>
Mon, 4 Jul 1994 21:50:03 +0000 (21:50 +0000)
committerRoland McGrath <roland@redhat.com>
Mon, 4 Jul 1994 21:50:03 +0000 (21:50 +0000)
(touch_file) [EINTR]: Do EINTR looping around fstat.

remake.c

index c7b183c4679a43ec6b6dec8711a4f25247d20bc4..452e7e545654205f3d241d5db729e61bb16cc3a4 100644 (file)
--- a/remake.c
+++ b/remake.c
@@ -777,8 +777,16 @@ touch_file (file)
        {
          struct stat statbuf;
          char buf;
+         int status;
 
-         if (fstat (fd, &statbuf) < 0)
+#ifdef EINTR
+         do
+#endif
+           status = fstat (fd, &statbuf);
+#ifdef EINTR
+         while (status < 0 && errno == EINTR);
+#endif
+         if (status < 0)
            TOUCH_ERROR ("touch: fstat: ");
          /* Rewrite character 0 same as it already is.  */
          if (read (fd, &buf, 1) < 0)
@@ -971,7 +979,7 @@ name_mtime (name)
 {
   struct stat st;
 
-  if (stat (name, &st) < 0)
+  if (safe_stat (name, &st) < 0)
     return (time_t) -1;
 
   return (time_t) st.st_mtime;