summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-event/sd-event.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-17 16:23:45 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-17 16:48:21 +0200
commit50e0d56cf37d8ca5b9162ab83906920392998623 (patch)
tree3563d821d18c57218de7e5a2bed8a283e7eb5f3f /src/libsystemd/sd-event/sd-event.c
parent1a37c9756f0c55917192e1a229977734b1f7ea45 (diff)
sd-bus: fix error handling of pthread API calls
pthread APIs (unlike the rest of libc) return their errors as positive error codes directly from the functions, rather than using errno. Let's make sure we always handle things that way.
Diffstat (limited to 'src/libsystemd/sd-event/sd-event.c')
-rw-r--r--src/libsystemd/sd-event/sd-event.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 1a82c4c940..1905ebfc73 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -1123,8 +1123,8 @@ _public_ int sd_event_add_signal(
callback = signal_exit_callback;
r = pthread_sigmask(SIG_SETMASK, NULL, &ss);
- if (r < 0)
- return -errno;
+ if (r != 0)
+ return -r;
if (!sigismember(&ss, sig))
return -EBUSY;