diff options
author | Roland McGrath <roland@redhat.com> | 1994-07-04 21:46:58 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 1994-07-04 21:46:58 +0000 |
commit | 710e8e6f6f8c43e68bc4ee067bf7c9e37ca1f4e6 (patch) | |
tree | 3076f0e86eda084748c0505dc212906481ec0f89 /misc.c | |
parent | 4a8a7637f39f9423eb20715879732f8710691ad9 (diff) | |
download | gunmake-710e8e6f6f8c43e68bc4ee067bf7c9e37ca1f4e6.tar.gz |
(safe_stat): New function, EINTR-safe wrapper around stat.
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -716,3 +716,23 @@ get_path_max () return value; } #endif + +/* On some systems, stat can return EINTR. */ + +int +safe_stat (name, buf) + char *name; + struct stat *buf; +{ + int ret; + +#ifdef EINTR + do +#endif + ret = stat (name, buf); +#ifdef EINTR + while (ret < 0 && errno == EINTR); +#endif + + return ret; +} |