summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/libsystemd.sym4
-rw-r--r--src/libsystemd/sd-bus/bus-message.c16
2 files changed, 13 insertions, 7 deletions
diff --git a/src/libsystemd/libsystemd.sym b/src/libsystemd/libsystemd.sym
index bb3c1ab4af..951166afa2 100644
--- a/src/libsystemd/libsystemd.sym
+++ b/src/libsystemd/libsystemd.sym
@@ -92,8 +92,8 @@ global:
sd_bus_message_get_sender;
sd_bus_message_get_error;
sd_bus_message_get_errno;
- sd_bus_message_get_monotonic_timestamp;
- sd_bus_message_get_realtime_timestamp;
+ sd_bus_message_get_monotonic_usec;
+ sd_bus_message_get_realtime_usec;
sd_bus_message_get_seqnum;
sd_bus_message_get_creds;
sd_bus_message_is_signal;
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 0c3913e2b0..2c25b3f5f1 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -880,19 +880,23 @@ _public_ const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m) {
return &m->error;
}
-_public_ int sd_bus_message_get_monotonic_timestamp(sd_bus_message *m, uint64_t *usec) {
+_public_ int sd_bus_message_get_monotonic_usec(sd_bus_message *m, uint64_t *usec) {
assert_return(m, -EINVAL);
assert_return(usec, -EINVAL);
- assert_return(m->monotonic > 0, -ENODATA);
+
+ if (m->monotonic <= 0)
+ return -ENODATA;
*usec = m->monotonic;
return 0;
}
-_public_ int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *usec) {
+_public_ int sd_bus_message_get_realtime_usec(sd_bus_message *m, uint64_t *usec) {
assert_return(m, -EINVAL);
assert_return(usec, -EINVAL);
- assert_return(m->realtime > 0, -ENODATA);
+
+ if (m->realtime <= 0)
+ return -ENODATA;
*usec = m->realtime;
return 0;
@@ -901,7 +905,9 @@ _public_ int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *
_public_ int sd_bus_message_get_seqnum(sd_bus_message *m, uint64_t *seqnum) {
assert_return(m, -EINVAL);
assert_return(seqnum, -EINVAL);
- assert_return(m->seqnum > 0, -ENODATA);
+
+ if (m->seqnum <= 0)
+ return -ENODATA;
*seqnum = m->seqnum;
return 0;