diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-11-04 16:27:05 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-11-04 18:09:19 +0100 |
commit | 356779df90a2ecab5da2cb310ad0f8ebc9ca9f46 (patch) | |
tree | cefebde8b6b947ec44bdfbd145b5a084528077a2 /src/libsystemd/sd-event | |
parent | e80afdb3e4a1239ce0bffa4215d6a227caf3d833 (diff) |
sd-event: rename sd_event_source_set_name() to sd_event_source_get_name()
To mirror the recent name change of the concept for sd_bus objects,
follow the same logic for sd_event_source objects, too.
Diffstat (limited to 'src/libsystemd/sd-event')
-rw-r--r-- | src/libsystemd/sd-event/sd-event.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index 80a2ae97e8..f0356a48e6 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -66,7 +66,7 @@ struct sd_event_source { void *userdata; sd_event_handler_t prepare; - char *name; + char *description; EventSourceType type:5; int enabled:3; @@ -737,7 +737,7 @@ static void source_free(sd_event_source *s) { assert(s); source_disconnect(s); - free(s->name); + free(s->description); free(s); } @@ -1253,18 +1253,17 @@ _public_ sd_event_source* sd_event_source_unref(sd_event_source *s) { return NULL; } -_public_ int sd_event_source_set_name(sd_event_source *s, const char *name) { +_public_ int sd_event_source_set_description(sd_event_source *s, const char *description) { assert_return(s, -EINVAL); - return free_and_strdup(&s->name, name); + return free_and_strdup(&s->description, description); } -_public_ int sd_event_source_get_name(sd_event_source *s, const char **name) { +_public_ int sd_event_source_get_description(sd_event_source *s, const char **description) { assert_return(s, -EINVAL); - assert_return(name, -EINVAL); - - *name = s->name; + assert_return(description, -EINVAL); + *description = s->description; return 0; } @@ -2152,8 +2151,8 @@ static int source_dispatch(sd_event_source *s) { s->dispatching = false; if (r < 0) { - if (s->name) - log_debug("Event source '%s' returned error, disabling: %s", s->name, strerror(-r)); + if (s->description) + log_debug("Event source '%s' returned error, disabling: %s", s->description, strerror(-r)); else log_debug("Event source %p returned error, disabling: %s", s, strerror(-r)); } @@ -2190,8 +2189,8 @@ static int event_prepare(sd_event *e) { s->dispatching = false; if (r < 0) { - if (s->name) - log_debug("Prepare callback of event source '%s' returned error, disabling: %s", s->name, strerror(-r)); + if (s->description) + log_debug("Prepare callback of event source '%s' returned error, disabling: %s", s->description, strerror(-r)); else log_debug("Prepare callback of event source %p returned error, disabling: %s", s, strerror(-r)); } |