summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/libreboot-utils/lib/file.c')
-rw-r--r--util/libreboot-utils/lib/file.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/util/libreboot-utils/lib/file.c b/util/libreboot-utils/lib/file.c
index ea2bcd0b..00cab2e9 100644
--- a/util/libreboot-utils/lib/file.c
+++ b/util/libreboot-utils/lib/file.c
@@ -732,6 +732,22 @@ try_err(int loop_err, int errval)
return -1;
}
+void
+close_no_err(int *fd)
+{
+ int saved_errno = errno;
+
+ if (fd == NULL)
+ return;
+ if (*fd < 0)
+ return;
+
+ (void) close_on_eintr(*fd);
+ *fd = -1;
+
+ errno = saved_errno;
+}
+
int
close_on_eintr(int fd)
{
@@ -1134,3 +1150,14 @@ retry:
return rval;
}
+
+
+
+
+
+
+
+
+
+
+