diff options
author | Paul Smith <psmith@gnu.org> | 2003-03-25 02:46:42 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2003-03-25 02:46:42 +0000 |
commit | 276d0c7c646eef13a40fcaccbda1a56bed1310c6 (patch) | |
tree | 10f32a4a6221cf5ba7196d2f19751849e03f80e5 /make.h | |
parent | 955899ef770fc289febe3f186e4533e09baa7076 (diff) | |
download | gunmake-276d0c7c646eef13a40fcaccbda1a56bed1310c6.tar.gz |
Fix bug #2846.
Diffstat (limited to 'make.h')
-rw-r--r-- | make.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -581,4 +581,13 @@ extern int handling_fatal_signal; #define EINTRLOOP(_v,_c) while (((_v)=_c)==-1 && errno==EINTR) -#define ENULLLOOP(_v,_c) while (((_v)=_c)==0 && errno==EINTR) +/* While system calls that return integers are pretty consistent about + returning -1 on failure and setting errno in that case, functions that + return pointers are not always so well behaved. Sometimes they return + NULL for expected behavior: one good example is readdir() which returns + NULL at the end of the directory--and _doesn't_ reset errno. So, we have + to do it ourselves here. */ + +#define ENULLLOOP(_v,_c) do{ errno = 0; \ + while (((_v)=_c)==0 && errno==EINTR); }while(0) + |