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 | |
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')
-rw-r--r-- | src/journal-remote/journal-remote.c | 10 | ||||
-rw-r--r-- | src/libsystemd-network/sd-dhcp-client.c | 21 | ||||
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-client.c | 18 | ||||
-rw-r--r-- | src/libsystemd-network/sd-icmp6-nd.c | 6 | ||||
-rw-r--r-- | src/libsystemd-network/sd-ipv4ll.c | 6 | ||||
-rw-r--r-- | src/libsystemd/libsystemd.sym.m4 | 4 | ||||
-rw-r--r-- | src/libsystemd/sd-bus/sd-bus.c | 8 | ||||
-rw-r--r-- | src/libsystemd/sd-event/sd-event.c | 23 | ||||
-rw-r--r-- | src/libsystemd/sd-rtnl/sd-rtnl.c | 6 | ||||
-rw-r--r-- | src/network/networkd-manager.c | 2 | ||||
-rw-r--r-- | src/systemd/sd-event.h | 4 |
11 files changed, 47 insertions, 61 deletions
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index dc7120bbd5..03410c7925 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -398,7 +398,7 @@ static int add_source(RemoteServer *s, int fd, char* name, bool own_name) { goto error; } - r = sd_event_source_set_name(source->event, name); + r = sd_event_source_set_description(source->event, name); if (r < 0) { log_error("Failed to set source name for fd:%d: %s", fd, strerror(-r)); goto error; @@ -426,7 +426,7 @@ static int add_raw_socket(RemoteServer *s, int fd) { snprintf(name, sizeof(name), "raw-socket-%d", fd); - r = sd_event_source_set_name(s->listen_event, name); + r = sd_event_source_set_description(s->listen_event, name); if (r < 0) return r; @@ -724,7 +724,7 @@ static int setup_microhttpd_server(RemoteServer *s, goto error; } - r = sd_event_source_set_name(d->event, "epoll-fd"); + r = sd_event_source_set_description(d->event, "epoll-fd"); if (r < 0) { log_error("Failed to set source name: %s", strerror(-r)); goto error; @@ -803,7 +803,7 @@ static int setup_signals(RemoteServer *s) { if (r < 0) return r; - r = sd_event_source_set_name(s->sigterm_event, "sigterm"); + r = sd_event_source_set_description(s->sigterm_event, "sigterm"); if (r < 0) return r; @@ -811,7 +811,7 @@ static int setup_signals(RemoteServer *s) { if (r < 0) return r; - r = sd_event_source_set_name(s->sigint_event, "sigint"); + r = sd_event_source_set_description(s->sigint_event, "sigint"); if (r < 0) return r; diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 1f7f238ca0..689163cffe 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -723,8 +723,7 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, if (r < 0) goto error; - r = sd_event_source_set_name(client->timeout_resend, - "dhcp4-resend-timer"); + r = sd_event_source_set_description(client->timeout_resend, "dhcp4-resend-timer"); if (r < 0) goto error; @@ -801,8 +800,7 @@ static int client_initialize_io_events(sd_dhcp_client *client, if (r < 0) goto error; - r = sd_event_source_set_name(client->receive_message, - "dhcp4-receive-message"); + r = sd_event_source_set_description(client->receive_message, "dhcp4-receive-message"); if (r < 0) goto error; @@ -832,8 +830,7 @@ static int client_initialize_time_events(sd_dhcp_client *client) { r = sd_event_source_set_priority(client->timeout_resend, client->event_priority); - r = sd_event_source_set_name(client->timeout_resend, - "dhcp4-resend-timer"); + r = sd_event_source_set_description(client->timeout_resend, "dhcp4-resend-timer"); if (r < 0) goto error; @@ -1149,8 +1146,7 @@ static int client_set_lease_timeouts(sd_dhcp_client *client) { if (r < 0) return r; - r = sd_event_source_set_name(client->timeout_expire, - "dhcp4-lifetime"); + r = sd_event_source_set_description(client->timeout_expire, "dhcp4-lifetime"); if (r < 0) return r; @@ -1177,8 +1173,7 @@ static int client_set_lease_timeouts(sd_dhcp_client *client) { if (r < 0) return r; - r = sd_event_source_set_name(client->timeout_t2, - "dhcp4-t2-timeout"); + r = sd_event_source_set_description(client->timeout_t2, "dhcp4-t2-timeout"); if (r < 0) return r; @@ -1204,8 +1199,7 @@ static int client_set_lease_timeouts(sd_dhcp_client *client) { if (r < 0) return r; - r = sd_event_source_set_name(client->timeout_t1, - "dhcp4-t1-timer"); + r = sd_event_source_set_description(client->timeout_t1, "dhcp4-t1-timer"); if (r < 0) return r; @@ -1250,8 +1244,7 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message, if (r < 0) goto error; - r = sd_event_source_set_name(client->timeout_resend, - "dhcp4-resend-timer"); + r = sd_event_source_set_description(client->timeout_resend, "dhcp4-resend-timer"); if (r < 0) goto error; } else if (r == -ENOMSG) diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index dbec1a2a8b..8537d7cc86 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -590,8 +590,7 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, if (r < 0) goto error; - r = sd_event_source_set_name(client->timeout_resend, - "dhcp6-resend-timer"); + r = sd_event_source_set_description(client->timeout_resend, "dhcp6-resend-timer"); if (r < 0) goto error; @@ -614,8 +613,7 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec, if (r < 0) goto error; - r = sd_event_source_set_name(client->timeout_resend_expire, - "dhcp6-resend-expire-timer"); + r = sd_event_source_set_description(client->timeout_resend_expire, "dhcp6-resend-expire-timer"); if (r < 0) goto error; } @@ -1010,8 +1008,7 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) if (r < 0) return r; - r = sd_event_source_set_name(client->receive_message, - "dhcp6-receive-message"); + r = sd_event_source_set_description(client->receive_message, "dhcp6-receive-message"); if (r < 0) return r; @@ -1059,8 +1056,7 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) if (r < 0) return r; - r = sd_event_source_set_name(client->lease->ia.timeout_t1, - "dhcp6-t1-timeout"); + r = sd_event_source_set_description(client->lease->ia.timeout_t1, "dhcp6-t1-timeout"); if (r < 0) return r; @@ -1084,8 +1080,7 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) if (r < 0) return r; - r = sd_event_source_set_name(client->lease->ia.timeout_t2, - "dhcp6-t2-timeout"); + r = sd_event_source_set_description(client->lease->ia.timeout_t2, "dhcp6-t2-timeout"); if (r < 0) return r; @@ -1108,8 +1103,7 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) if (r < 0) return r; - r = sd_event_source_set_name(client->timeout_resend, - "dhcp6-resend-timeout"); + r = sd_event_source_set_description(client->timeout_resend, "dhcp6-resend-timeout"); if (r < 0) return r; diff --git a/src/libsystemd-network/sd-icmp6-nd.c b/src/libsystemd-network/sd-icmp6-nd.c index bbb4531ddb..2473fbbddf 100644 --- a/src/libsystemd-network/sd-icmp6-nd.c +++ b/src/libsystemd-network/sd-icmp6-nd.c @@ -278,7 +278,7 @@ static int icmp6_router_solicitation_timeout(sd_event_source *s, uint64_t usec, return 0; } - r = sd_event_source_set_name(nd->timeout, "icmp6-timeout"); + r = sd_event_source_set_description(nd->timeout, "icmp6-timeout"); if (r < 0) { icmp6_nd_notify(nd, r); return 0; @@ -328,7 +328,7 @@ int sd_icmp6_router_solicitation_start(sd_icmp6_nd *nd) { if (r < 0) goto error; - r = sd_event_source_set_name(nd->recv, "icmp6-receive-message"); + r = sd_event_source_set_description(nd->recv, "icmp6-receive-message"); if (r < 0) goto error; @@ -341,7 +341,7 @@ int sd_icmp6_router_solicitation_start(sd_icmp6_nd *nd) { if (r < 0) goto error; - r = sd_event_source_set_name(nd->timeout, "icmp6-timeout"); + r = sd_event_source_set_description(nd->timeout, "icmp6-timeout"); error: if (r < 0) icmp6_nd_init(nd); diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index 8b243319b6..8626d4afa9 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -353,7 +353,7 @@ static void ipv4ll_run_state_machine(sd_ipv4ll *ll, IPv4LLTrigger trigger, void if (r < 0) goto out; - r = sd_event_source_set_name(ll->timer, "ipv4ll-timer"); + r = sd_event_source_set_description(ll->timer, "ipv4ll-timer"); if (r < 0) goto out; } @@ -564,7 +564,7 @@ int sd_ipv4ll_start (sd_ipv4ll *ll) { if (r < 0) goto out; - r = sd_event_source_set_name(ll->receive_message, "ipv4ll-receive-message"); + r = sd_event_source_set_description(ll->receive_message, "ipv4ll-receive-message"); if (r < 0) goto out; @@ -581,7 +581,7 @@ int sd_ipv4ll_start (sd_ipv4ll *ll) { if (r < 0) goto out; - r = sd_event_source_set_name(ll->timer, "ipv4ll-timer"); + r = sd_event_source_set_description(ll->timer, "ipv4ll-timer"); out: if (r < 0) ipv4ll_stop(ll, IPV4LL_EVENT_STOP); 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; diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 2213ad717c..2c8a330d75 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -368,7 +368,7 @@ int manager_udev_listen(Manager *m) { if (r < 0) return r; - r = sd_event_source_set_name(m->udev_event_source, "networkd-udev"); + r = sd_event_source_set_description(m->udev_event_source, "networkd-udev"); if (r < 0) return r; diff --git a/src/systemd/sd-event.h b/src/systemd/sd-event.h index 0dbdcdf2a5..25a10f99ab 100644 --- a/src/systemd/sd-event.h +++ b/src/systemd/sd-event.h @@ -109,8 +109,8 @@ sd_event *sd_event_source_get_event(sd_event_source *s); void* sd_event_source_get_userdata(sd_event_source *s); void* sd_event_source_set_userdata(sd_event_source *s, void *userdata); -int sd_event_source_set_name(sd_event_source *s, const char *name); -int sd_event_source_get_name(sd_event_source *s, const char **name); +int sd_event_source_set_description(sd_event_source *s, const char *description); +int sd_event_source_get_description(sd_event_source *s, const char **description); int sd_event_source_set_prepare(sd_event_source *s, sd_event_handler_t callback); int sd_event_source_get_pending(sd_event_source *s); int sd_event_source_get_priority(sd_event_source *s, int64_t *priority); |