chiark / gitweb /
sd-event: fix sd_event_source_get_priority() (#4712)
authorMartin Ejdestig <marejde@gmail.com>
Tue, 22 Nov 2016 00:21:00 +0000 (01:21 +0100)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:35 +0000 (17:58 +0200)
To properly store priority in passed in pointer and return 0 for success.
Also add a test for verifying that it works correctly.

src/libelogind/sd-event/sd-event.c

index c3673f08a65a0b1d8d8ff7b214fa442ff1630c03..383de48d55fb712aaf6bb00e05619cda66bdc7e6 100644 (file)
@@ -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