summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.c b/util.c
index 56f53eafd6..38ed74fbcb 100644
--- a/util.c
+++ b/util.c
@@ -97,6 +97,14 @@ int close_nointr(int fd) {
}
}
+void close_nointr_nofail(int fd) {
+
+ /* like close_nointr() but cannot fail, and guarantees errno
+ * is unchanged */
+
+ assert_se(close_nointr(fd) == 0);
+}
+
int parse_boolean(const char *v) {
assert(v);