diff options
author | Paul Smith <psmith@gnu.org> | 2002-09-10 07:27:28 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2002-09-10 07:27:28 +0000 |
commit | 7ea029a07c02b9401cb3d88566eac41959b84c11 (patch) | |
tree | 0a26e865bee26f79c718258415b5389023076942 /misc.c | |
parent | 9b41488ad15e4ffc63b8094379c17f567b094c1b (diff) | |
download | gunmake-7ea029a07c02b9401cb3d88566eac41959b84c11.tar.gz |
Add support for broken SA_RESTART on PTX.
Fix bug #103: allow ifdef, export, and unexport to expand their arguments.
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -856,3 +856,38 @@ get_path_max () return value; } #endif + + +#ifdef HAVE_BROKEN_RESTART + +#undef stat +#undef readdir + +int +atomic_stat(file, buf) + 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 *file; +{ + struct dirent *r; + + while ((r = readdir (file, buf)) == NULL) + if (errno != EINTR) + break; + + return r; +} + +#endif /* HAVE_BROKEN_RESTART */ |