summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-04 16:27:05 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-04 18:09:19 +0100
commit356779df90a2ecab5da2cb310ad0f8ebc9ca9f46 (patch)
treecefebde8b6b947ec44bdfbd145b5a084528077a2 /src/libsystemd
parente80afdb3e4a1239ce0bffa4215d6a227caf3d833 (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')
-rw-r--r--src/libsystemd/libsystemd.sym.m44
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c8
-rw-r--r--src/libsystemd/sd-event/sd-event.c23
-rw-r--r--src/libsystemd/sd-rtnl/sd-rtnl.c6
4 files changed, 20 insertions, 21 deletions
diff --git a/src/libsystemd/libsystemd.sym.m4 b/src/libsystemd/libsystemd.sym.m4
index c32d8d90db..04581c50cf 100644
--- a/src/libsystemd/libsystemd.sym.m4
+++ b/src/libsystemd/libsystemd.sym.m4
@@ -387,8 +387,8 @@ global:
sd_event_get_watchdog;
sd_event_source_ref;
sd_event_source_unref;
- sd_event_source_set_name;
- sd_event_source_get_name;
+ sd_event_source_set_description;
+ sd_event_source_get_description;
sd_event_source_set_prepare;
sd_event_source_get_pending;
sd_event_source_get_priority;
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 318cf6bae5..251720a6ba 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -3015,7 +3015,7 @@ static int attach_io_events(sd_bus *bus) {
if (r < 0)
return r;
- r = sd_event_source_set_name(bus->input_io_event_source, "bus-input");
+ r = sd_event_source_set_description(bus->input_io_event_source, "bus-input");
} else
r = sd_event_source_set_io_fd(bus->input_io_event_source, bus->input_fd);
@@ -3034,7 +3034,7 @@ static int attach_io_events(sd_bus *bus) {
if (r < 0)
return r;
- r = sd_event_source_set_name(bus->input_io_event_source, "bus-output");
+ r = sd_event_source_set_description(bus->input_io_event_source, "bus-output");
} else
r = sd_event_source_set_io_fd(bus->output_io_event_source, bus->output_fd);
@@ -3087,7 +3087,7 @@ _public_ int sd_bus_attach_event(sd_bus *bus, sd_event *event, int priority) {
if (r < 0)
goto fail;
- r = sd_event_source_set_name(bus->time_event_source, "bus-time");
+ r = sd_event_source_set_description(bus->time_event_source, "bus-time");
if (r < 0)
goto fail;
@@ -3095,7 +3095,7 @@ _public_ int sd_bus_attach_event(sd_bus *bus, sd_event *event, int priority) {
if (r < 0)
goto fail;
- r = sd_event_source_set_name(bus->quit_event_source, "bus-exit");
+ r = sd_event_source_set_description(bus->quit_event_source, "bus-exit");
if (r < 0)
goto fail;
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));
}
diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c
index b7f1afe905..1af38f3667 100644
--- a/src/libsystemd/sd-rtnl/sd-rtnl.c
+++ b/src/libsystemd/sd-rtnl/sd-rtnl.c
@@ -859,7 +859,7 @@ int sd_rtnl_attach_event(sd_rtnl *rtnl, sd_event *event, int priority) {
if (r < 0)
goto fail;
- r = sd_event_source_set_name(rtnl->io_event_source, "rtnl-receive-message");
+ r = sd_event_source_set_description(rtnl->io_event_source, "rtnl-receive-message");
if (r < 0)
goto fail;
@@ -875,7 +875,7 @@ int sd_rtnl_attach_event(sd_rtnl *rtnl, sd_event *event, int priority) {
if (r < 0)
goto fail;
- r = sd_event_source_set_name(rtnl->time_event_source, "rtnl-timer");
+ r = sd_event_source_set_description(rtnl->time_event_source, "rtnl-timer");
if (r < 0)
goto fail;
@@ -883,7 +883,7 @@ int sd_rtnl_attach_event(sd_rtnl *rtnl, sd_event *event, int priority) {
if (r < 0)
goto fail;
- r = sd_event_source_set_name(rtnl->exit_event_source, "rtnl-exit");
+ r = sd_event_source_set_description(rtnl->exit_event_source, "rtnl-exit");
if (r < 0)
goto fail;