summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-event/sd-event.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-14 12:45:06 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-14 18:23:16 +0200
commit8ac43fee1a2890d62edfe29282f66780bc1b634f (patch)
tree2cb28d2f3df4780399a395ef615dc24ebc4ab4cf /src/libsystemd/sd-event/sd-event.c
parentc5974b33e7fa3b777e72181d0fc0d1d22fdab2cd (diff)
tree-wide: generate EBADF when we get invalid fds
This is a follow-up to #907, and makes the same change for all our other public APIs.
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 754fb7614e..0e33ced342 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -816,7 +816,7 @@ _public_ int sd_event_add_io(
int r;
assert_return(e, -EINVAL);
- assert_return(fd >= 0, -EINVAL);
+ assert_return(fd >= 0, -EBADF);
assert_return(!(events & ~(EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLPRI|EPOLLERR|EPOLLHUP|EPOLLET)), -EINVAL);
assert_return(callback, -EINVAL);
assert_return(e->state != SD_EVENT_FINISHED, -ESTALE);
@@ -1311,7 +1311,7 @@ _public_ int sd_event_source_set_io_fd(sd_event_source *s, int fd) {
int r;
assert_return(s, -EINVAL);
- assert_return(fd >= 0, -EINVAL);
+ assert_return(fd >= 0, -EBADF);
assert_return(s->type == SOURCE_IO, -EDOM);
assert_return(!event_pid_changed(s->event), -ECHILD);