diff options
Diffstat (limited to 'dlib')
-rw-r--r-- | dlib/dlib.c | 12 | ||||
-rw-r--r-- | dlib/dlib.h | 8 |
2 files changed, 16 insertions, 4 deletions
diff --git a/dlib/dlib.c b/dlib/dlib.c index ebdaf0cd..d60f1bc6 100644 --- a/dlib/dlib.c +++ b/dlib/dlib.c @@ -931,3 +931,15 @@ char *dGetline (FILE *stream) return line; } +/* + * Close a FD handling EINTR. + */ +int dClose(int fd) +{ + int st; + + do + st = close(fd); + while (st == -1 && errno == EINTR); + return st; +} diff --git a/dlib/dlib.h b/dlib/dlib.h index 8dc324a7..0d194dbe 100644 --- a/dlib/dlib.h +++ b/dlib/dlib.h @@ -175,10 +175,10 @@ void dLib_show_messages(bool_t show); /* *- Misc utility functions ---------------------------------------------------- */ -char *dGetcwd (); -char *dGethomedir (); -char *dGetline (FILE *stream); - +char *dGetcwd(); +char *dGethomedir(); +char *dGetline(FILE *stream); +int dClose(int fd); #ifdef __cplusplus } |