From: Roland McGrath Date: Mon, 4 Jul 1994 21:46:58 +0000 (+0000) Subject: (safe_stat): New function, EINTR-safe wrapper around stat. X-Git-Tag: 3.71.2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=710e8e6f6f8c43e68bc4ee067bf7c9e37ca1f4e6;p=thirdparty%2Fmake.git (safe_stat): New function, EINTR-safe wrapper around stat. --- diff --git a/misc.c b/misc.c index 06be0b27..b9e76b9b 100644 --- a/misc.c +++ b/misc.c @@ -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; +}