diff options
author | Roland McGrath <roland@redhat.com> | 1994-07-04 21:50:03 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 1994-07-04 21:50:03 +0000 |
commit | b574b8ea5a2c91bee40dc8c5f1b8f938928b162a (patch) | |
tree | 339236be5f04f219100d2ff5aa8a5a395c26d72b /remake.c | |
parent | 710e8e6f6f8c43e68bc4ee067bf7c9e37ca1f4e6 (diff) | |
download | make-b574b8ea5a2c91bee40dc8c5f1b8f938928b162a.tar.gz |
(name_mtime): Use safe_stat in place of stat.
(touch_file) [EINTR]: Do EINTR looping around fstat.
Diffstat (limited to 'remake.c')
-rw-r--r-- | remake.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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; |