mirror of
https://github.com/systemd/systemd.git
synced 2026-08-02 22:20:20 +00:00
add non-failing close() variant
This commit is contained in:
8
util.c
8
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user