mirror of
https://github.com/mirror/make.git
synced 2026-08-23 02:13:28 +08:00
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).
This commit is contained in:
32
misc.c
32
misc.c
@@ -828,35 +828,3 @@ get_path_max (void)
|
||||
return value;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_BROKEN_RESTART
|
||||
|
||||
#undef stat
|
||||
#undef readdir
|
||||
|
||||
int
|
||||
atomic_stat (const char *file, struct stat *buf)
|
||||
{
|
||||
int r;
|
||||
|
||||
while ((r = stat (file, buf)) < 0)
|
||||
if (errno != EINTR)
|
||||
break;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
struct dirent *
|
||||
atomic_readdir (DIR *dir)
|
||||
{
|
||||
struct dirent *r;
|
||||
|
||||
while ((r = readdir (dir)) == NULL)
|
||||
if (errno != EINTR)
|
||||
break;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif /* HAVE_BROKEN_RESTART */
|
||||
|
||||
Reference in New Issue
Block a user