summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-02 16:31:55 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-02 17:47:59 +0200
commit5c0aa72a4999bdcf03fe93ed5c8213c2b4c681f0 (patch)
tree470f285684f6b3e79f9ff8c561deaa07a166cb07 /src/shared/util.c
parent2875e22b65452896d5569eecb3a08265dd658173 (diff)
util: add a bit of syntactic sugar for saving/restoring errno
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 46c20bec9c..b69e7e882a 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -207,14 +207,12 @@ int close_nointr(int fd) {
}
void close_nointr_nofail(int fd) {
- int saved_errno = errno;
+ PROTECT_ERRNO;
/* like close_nointr() but cannot fail, and guarantees errno
* is unchanged */
assert_se(close_nointr(fd) == 0);
-
- errno = saved_errno;
}
void close_many(const int fds[], unsigned n_fd) {