diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-28 01:53:15 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-28 01:53:15 +0100 |
commit | 85f136b5d09168a7e4fd2ad27ef81dbe2d356c07 (patch) | |
tree | 11a007bb931e4484e646423f184155cc4cabcf98 /util.c | |
parent | 4901f972785c4cd3a2cc10a8f4b6ce4e2ab3a568 (diff) |
add non-failing close() variant
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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); |