summaryrefslogtreecommitdiff
path: root/dlib/dlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'dlib/dlib.c')
-rw-r--r--dlib/dlib.c12
1 files changed, 12 insertions, 0 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;
+}