summaryrefslogtreecommitdiff
path: root/remake.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2003-01-30 05:22:52 +0000
committerPaul Smith <psmith@gnu.org>2003-01-30 05:22:52 +0000
commitd33ff301454fa1db9919674dbc2a37309bbd529f (patch)
treeb843b352a445c03c8d1f4c2265334ea0e83de046 /remake.c
parentd15a484098a52e0784933ba03a98445fdc86ea3f (diff)
downloadgunmake-d33ff301454fa1db9919674dbc2a37309bbd529f.tar.gz
Portability fix for glob.h building in FreeBSD ports system.
Implement a fix for bug # 2169: too many OSs, even major OSs like Solaris, don't properly implement SA_RESTART: important system calls like stat() can still fail when SA_RESTART is set. So, forget the BROKEN_RESTART config check and get rid of atomic_stat() and atomic_readdir(), and implement permanent wrappers for EINTR checking on various system calls (stat(), fstat(), opendir(), and readdir() so far).
Diffstat (limited to 'remake.c')
-rw-r--r--remake.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/remake.c b/remake.c
index db1dd2c..c679d11 100644
--- a/remake.c
+++ b/remake.c
@@ -961,8 +961,10 @@ touch_file (struct file *file)
{
struct stat statbuf;
char buf;
+ int e;
- if (fstat (fd, &statbuf) < 0)
+ EINTRLOOP (e, fstat (fd, &statbuf));
+ if (e < 0)
TOUCH_ERROR ("touch: fstat: ");
/* Rewrite character 0 same as it already is. */
if (read (fd, &buf, 1) < 0)
@@ -1257,8 +1259,10 @@ static FILE_TIMESTAMP
name_mtime (char *name)
{
struct stat st;
+ int e;
- if (stat (name, &st) != 0)
+ EINTRLOOP (e, stat (name, &st));
+ if (e != 0)
{
if (errno != ENOENT && errno != ENOTDIR)
perror_with_name ("stat:", name);