From: Martin Ejdestig Date: Tue, 22 Nov 2016 00:21:00 +0000 (+0100) Subject: sd-event: fix sd_event_source_get_priority() (#4712) X-Git-Tag: v233.3~150 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=971e2488dda5dbdfddc29adabc9a10590b084ba5;hp=d541b31cc867960110c5fb974ecc1b2f78299196 sd-event: fix sd_event_source_get_priority() (#4712) To properly store priority in passed in pointer and return 0 for success. Also add a test for verifying that it works correctly. --- diff --git a/src/libelogind/sd-event/sd-event.c b/src/libelogind/sd-event/sd-event.c index c3673f08a..383de48d5 100644 --- a/src/libelogind/sd-event/sd-event.c +++ b/src/libelogind/sd-event/sd-event.c @@ -1552,7 +1552,8 @@ _public_ int sd_event_source_get_priority(sd_event_source *s, int64_t *priority) assert_return(s, -EINVAL); assert_return(!event_pid_changed(s->event), -ECHILD); - return s->priority; + *priority = s->priority; + return 0; } #endif // 0