From cbba835b154ba31e7a07ba1b15a06b8953eb7e72 Mon Sep 17 00:00:00 2001 From: Jorge Arellano Cid Date: Wed, 9 Jan 2013 12:47:23 -0300 Subject: Refactored FD close calls into a single new dClose() dlib function [p37sitdu] --- dlib/dlib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'dlib/dlib.c') 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; +} -- cgit v1.2.3