diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-04-29 18:35:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-04-29 18:36:25 +0200 |
commit | 190700621f95160d364f8ec1d3e360246c41ce75 (patch) | |
tree | 783c3b43bd6fd93892fada76f5c20112a4e73d7c /src/login | |
parent | b53c3c2d24ed1398ee427139cd880b07bc35fa24 (diff) |
sd-bus: drop bus parameter from message callback prototype
This should simplify the prototype a bit. The bus parameter is redundant
in most cases, and in the few where it matters it can be derived from
the message via sd_bus_message_get_bus().
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-dbus.c | 145 | ||||
-rw-r--r-- | src/login/logind-seat-dbus.c | 15 | ||||
-rw-r--r-- | src/login/logind-seat.h | 2 | ||||
-rw-r--r-- | src/login/logind-session-dbus.c | 30 | ||||
-rw-r--r-- | src/login/logind-session.h | 8 | ||||
-rw-r--r-- | src/login/logind-user-dbus.c | 6 | ||||
-rw-r--r-- | src/login/logind-user.h | 4 | ||||
-rw-r--r-- | src/login/logind.h | 10 |
8 files changed, 89 insertions, 131 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 880fbf73ca..7603b0ec72 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -243,14 +243,13 @@ static int property_get_scheduled_shutdown( static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_handle_action, handle_action, HandleAction); -static int method_get_session(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_get_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; Manager *m = userdata; const char *name; Session *session; int r; - assert(bus); assert(message); assert(m); @@ -269,14 +268,13 @@ static int method_get_session(sd_bus *bus, sd_bus_message *message, void *userda return sd_bus_reply_method_return(message, "o", p); } -static int method_get_session_by_pid(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_get_session_by_pid(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; Session *session = NULL; Manager *m = userdata; pid_t pid; int r; - assert(bus); assert(message); assert(m); @@ -306,14 +304,13 @@ static int method_get_session_by_pid(sd_bus *bus, sd_bus_message *message, void return sd_bus_reply_method_return(message, "o", p); } -static int method_get_user(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_get_user(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; Manager *m = userdata; uint32_t uid; User *user; int r; - assert(bus); assert(message); assert(m); @@ -332,14 +329,13 @@ static int method_get_user(sd_bus *bus, sd_bus_message *message, void *userdata, return sd_bus_reply_method_return(message, "o", p); } -static int method_get_user_by_pid(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_get_user_by_pid(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; Manager *m = userdata; User *user = NULL; pid_t pid; int r; - assert(bus); assert(message); assert(m); @@ -368,14 +364,13 @@ static int method_get_user_by_pid(sd_bus *bus, sd_bus_message *message, void *us return sd_bus_reply_method_return(message, "o", p); } -static int method_get_seat(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_get_seat(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; Manager *m = userdata; const char *name; Seat *seat; int r; - assert(bus); assert(message); assert(m); @@ -394,14 +389,13 @@ static int method_get_seat(sd_bus *bus, sd_bus_message *message, void *userdata, return sd_bus_reply_method_return(message, "o", p); } -static int method_list_sessions(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_list_sessions(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; Manager *m = userdata; Session *session; Iterator i; int r; - assert(bus); assert(message); assert(m); @@ -434,17 +428,16 @@ static int method_list_sessions(sd_bus *bus, sd_bus_message *message, void *user if (r < 0) return r; - return sd_bus_send(bus, reply, NULL); + return sd_bus_send(sd_bus_message_get_bus(reply), reply, NULL); } -static int method_list_users(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_list_users(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; Manager *m = userdata; User *user; Iterator i; int r; - assert(bus); assert(message); assert(m); @@ -475,17 +468,16 @@ static int method_list_users(sd_bus *bus, sd_bus_message *message, void *userdat if (r < 0) return r; - return sd_bus_send(bus, reply, NULL); + return sd_bus_send(sd_bus_message_get_bus(reply), reply, NULL); } -static int method_list_seats(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_list_seats(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; Manager *m = userdata; Seat *seat; Iterator i; int r; - assert(bus); assert(message); assert(m); @@ -513,16 +505,19 @@ static int method_list_seats(sd_bus *bus, sd_bus_message *message, void *userdat if (r < 0) return r; - return sd_bus_send(bus, reply, NULL); + return sd_bus_send(sd_bus_message_get_bus(reply), reply, NULL); } -static int method_list_inhibitors(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_list_inhibitors(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; Manager *m = userdata; Inhibitor *inhibitor; Iterator i; int r; + assert(message); + assert(m); + r = sd_bus_message_new_method_return(message, &reply); if (r < 0) return r; @@ -548,10 +543,10 @@ static int method_list_inhibitors(sd_bus *bus, sd_bus_message *message, void *us if (r < 0) return r; - return sd_bus_send(bus, reply, NULL); + return sd_bus_send(sd_bus_message_get_bus(reply), reply, NULL); } -static int method_create_session(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_create_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { const char *service, *type, *class, *cseat, *tty, *display, *remote_user, *remote_host, *desktop; uint32_t uid, leader, audit_id = 0; _cleanup_free_ char *id = NULL; @@ -565,7 +560,6 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use SessionClass c; int r; - assert(bus); assert(message); assert(m); @@ -841,13 +835,12 @@ fail: return r; } -static int method_release_session(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_release_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; Session *session; const char *name; int r; - assert(bus); assert(message); assert(m); @@ -866,13 +859,12 @@ static int method_release_session(sd_bus *bus, sd_bus_message *message, void *us return sd_bus_reply_method_return(message, NULL); } -static int method_activate_session(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_activate_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; Session *session; const char *name; int r; - assert(bus); assert(message); assert(m); @@ -884,17 +876,16 @@ static int method_activate_session(sd_bus *bus, sd_bus_message *message, void *u if (r < 0) return r; - return bus_session_method_activate(bus, message, session, error); + return bus_session_method_activate(message, session, error); } -static int method_activate_session_on_seat(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_activate_session_on_seat(sd_bus_message *message, void *userdata, sd_bus_error *error) { const char *session_name, *seat_name; Manager *m = userdata; Session *session; Seat *seat; int r; - assert(bus); assert(message); assert(m); @@ -923,13 +914,12 @@ static int method_activate_session_on_seat(sd_bus *bus, sd_bus_message *message, return sd_bus_reply_method_return(message, NULL); } -static int method_lock_session(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_lock_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; Session *session; const char *name; int r; - assert(bus); assert(message); assert(m); @@ -941,14 +931,13 @@ static int method_lock_session(sd_bus *bus, sd_bus_message *message, void *userd if (r < 0) return r; - return bus_session_method_lock(bus, message, session, error); + return bus_session_method_lock(message, session, error); } -static int method_lock_sessions(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_lock_sessions(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; int r; - assert(bus); assert(message); assert(m); @@ -972,13 +961,12 @@ static int method_lock_sessions(sd_bus *bus, sd_bus_message *message, void *user return sd_bus_reply_method_return(message, NULL); } -static int method_kill_session(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_kill_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { const char *name; Manager *m = userdata; Session *session; int r; - assert(bus); assert(message); assert(m); @@ -990,16 +978,15 @@ static int method_kill_session(sd_bus *bus, sd_bus_message *message, void *userd if (r < 0) return r; - return bus_session_method_kill(bus, message, session, error); + return bus_session_method_kill(message, session, error); } -static int method_kill_user(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_kill_user(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; uint32_t uid; User *user; int r; - assert(bus); assert(message); assert(m); @@ -1011,16 +998,15 @@ static int method_kill_user(sd_bus *bus, sd_bus_message *message, void *userdata if (r < 0) return r; - return bus_user_method_kill(bus, message, user, error); + return bus_user_method_kill(message, user, error); } -static int method_terminate_session(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_terminate_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; const char *name; Session *session; int r; - assert(bus); assert(message); assert(m); @@ -1032,16 +1018,15 @@ static int method_terminate_session(sd_bus *bus, sd_bus_message *message, void * if (r < 0) return r; - return bus_session_method_terminate(bus, message, session, error); + return bus_session_method_terminate(message, session, error); } -static int method_terminate_user(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_terminate_user(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; uint32_t uid; User *user; int r; - assert(bus); assert(message); assert(m); @@ -1053,16 +1038,15 @@ static int method_terminate_user(sd_bus *bus, sd_bus_message *message, void *use if (r < 0) return r; - return bus_user_method_terminate(bus, message, user, error); + return bus_user_method_terminate(message, user, error); } -static int method_terminate_seat(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_terminate_seat(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; const char *name; Seat *seat; int r; - assert(bus); assert(message); assert(m); @@ -1074,10 +1058,10 @@ static int method_terminate_seat(sd_bus *bus, sd_bus_message *message, void *use if (r < 0) return r; - return bus_seat_method_terminate(bus, message, seat, error); + return bus_seat_method_terminate(message, seat, error); } -static int method_set_user_linger(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_set_user_linger(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *cc = NULL; Manager *m = userdata; int b, r; @@ -1086,7 +1070,6 @@ static int method_set_user_linger(sd_bus *bus, sd_bus_message *message, void *us uint32_t uid; int interactive; - assert(bus); assert(message); assert(m); @@ -1266,12 +1249,11 @@ static int flush_devices(Manager *m) { return trigger_device(m, NULL); } -static int method_attach_device(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_attach_device(sd_bus_message *message, void *userdata, sd_bus_error *error) { const char *sysfs, *seat; Manager *m = userdata; int interactive, r; - assert(bus); assert(message); assert(m); @@ -1305,11 +1287,10 @@ static int method_attach_device(sd_bus *bus, sd_bus_message *message, void *user return sd_bus_reply_method_return(message, NULL); } -static int method_flush_devices(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_flush_devices(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; int interactive, r; - assert(bus); assert(message); assert(m); @@ -1728,7 +1709,7 @@ static int method_do_shutdown_or_sleep( return sd_bus_reply_method_return(message, NULL); } -static int method_poweroff(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_poweroff(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_do_shutdown_or_sleep( @@ -1742,7 +1723,7 @@ static int method_poweroff(sd_bus *bus, sd_bus_message *message, void *userdata, error); } -static int method_reboot(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_reboot(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_do_shutdown_or_sleep( @@ -1756,7 +1737,7 @@ static int method_reboot(sd_bus *bus, sd_bus_message *message, void *userdata, s error); } -static int method_suspend(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_suspend(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_do_shutdown_or_sleep( @@ -1864,7 +1845,7 @@ static int manager_scheduled_shutdown_handler( return 0; } -static int method_schedule_shutdown(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_schedule_shutdown(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; const char *action_multiple_sessions = NULL; @@ -1967,7 +1948,7 @@ static int method_schedule_shutdown(sd_bus *bus, sd_bus_message *message, void * return sd_bus_reply_method_return(message, NULL); } -static int method_cancel_scheduled_shutdown(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_cancel_scheduled_shutdown(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; bool cancelled; @@ -2002,7 +1983,7 @@ static int method_cancel_scheduled_shutdown(sd_bus *bus, sd_bus_message *message return sd_bus_reply_method_return(message, "b", cancelled); } -static int method_hibernate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_hibernate(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_do_shutdown_or_sleep( @@ -2016,7 +1997,7 @@ static int method_hibernate(sd_bus *bus, sd_bus_message *message, void *userdata error); } -static int method_hybrid_sleep(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_hybrid_sleep(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_do_shutdown_or_sleep( @@ -2122,7 +2103,7 @@ static int method_can_shutdown_or_sleep( return sd_bus_reply_method_return(message, "s", result); } -static int method_can_poweroff(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_can_poweroff(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_can_shutdown_or_sleep( @@ -2135,7 +2116,7 @@ static int method_can_poweroff(sd_bus *bus, sd_bus_message *message, void *userd error); } -static int method_can_reboot(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_can_reboot(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_can_shutdown_or_sleep( @@ -2148,7 +2129,7 @@ static int method_can_reboot(sd_bus *bus, sd_bus_message *message, void *userdat error); } -static int method_can_suspend(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_can_suspend(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_can_shutdown_or_sleep( @@ -2161,7 +2142,7 @@ static int method_can_suspend(sd_bus *bus, sd_bus_message *message, void *userda error); } -static int method_can_hibernate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_can_hibernate(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_can_shutdown_or_sleep( @@ -2174,7 +2155,7 @@ static int method_can_hibernate(sd_bus *bus, sd_bus_message *message, void *user error); } -static int method_can_hybrid_sleep(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_can_hybrid_sleep(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; return method_can_shutdown_or_sleep( @@ -2209,7 +2190,6 @@ static int property_get_reboot_to_firmware_setup( } static int method_set_reboot_to_firmware_setup( - sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { @@ -2217,7 +2197,6 @@ static int method_set_reboot_to_firmware_setup( int b, r; Manager *m = userdata; - assert(bus); assert(message); assert(m); @@ -2245,7 +2224,6 @@ static int method_set_reboot_to_firmware_setup( } static int method_can_reboot_to_firmware_setup( - sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { @@ -2255,7 +2233,6 @@ static int method_can_reboot_to_firmware_setup( const char *result; Manager *m = userdata; - assert(bus); assert(message); assert(m); @@ -2284,7 +2261,7 @@ static int method_can_reboot_to_firmware_setup( return sd_bus_reply_method_return(message, "s", result); } -static int method_inhibit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_inhibit(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; const char *who, *why, *what, *mode; _cleanup_free_ char *id = NULL; @@ -2297,7 +2274,6 @@ static int method_inhibit(sd_bus *bus, sd_bus_message *message, void *userdata, uid_t uid; int r; - assert(bus); assert(message); assert(m); @@ -2500,7 +2476,7 @@ static int session_jobs_reply(Session *s, const char *unit, const char *result) return r; } -int match_job_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *error) { const char *path, *result, *unit; Manager *m = userdata; Session *session; @@ -2508,7 +2484,6 @@ int match_job_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_b User *user; int r; - assert(bus); assert(message); assert(m); @@ -2569,14 +2544,13 @@ int match_job_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_b return 0; } -int match_unit_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *error) { const char *path, *unit; Manager *m = userdata; Session *session; User *user; int r; - assert(bus); assert(message); assert(m); @@ -2597,7 +2571,7 @@ int match_unit_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_ return 0; } -int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *unit = NULL; Manager *m = userdata; const char *path; @@ -2605,7 +2579,6 @@ int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdat User *user; int r; - assert(bus); assert(message); assert(m); @@ -2630,13 +2603,14 @@ int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdat return 0; } -int match_reloading(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error) { Manager *m = userdata; Session *session; Iterator i; int b, r; - assert(bus); + assert(message); + assert(m); r = sd_bus_message_read(message, "b", &b); if (r < 0) { @@ -2656,16 +2630,17 @@ int match_reloading(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus return 0; } -int match_name_owner_changed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int match_name_owner_changed(sd_bus_message *message, void *userdata, sd_bus_error *error) { const char *name, *old, *new; Manager *m = userdata; Session *session; Iterator i; int r; - - char *key; + assert(message); + assert(m); + r = sd_bus_message_read(message, "sss", &name, &old, &new); if (r < 0) { bus_log_parse_error(r); diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c index f50ee8d759..ce67ffde37 100644 --- a/src/login/logind-seat-dbus.c +++ b/src/login/logind-seat-dbus.c @@ -193,11 +193,10 @@ static int property_get_idle_since_hint( return sd_bus_message_append(reply, "t", u); } -int bus_seat_method_terminate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int bus_seat_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error) { Seat *s = userdata; int r; - assert(bus); assert(message); assert(s); @@ -221,13 +220,12 @@ int bus_seat_method_terminate(sd_bus *bus, sd_bus_message *message, void *userda return sd_bus_reply_method_return(message, NULL); } -static int method_activate_session(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_activate_session(sd_bus_message *message, void *userdata, sd_bus_error *error) { Seat *s = userdata; const char *name; Session *session; int r; - assert(bus); assert(message); assert(s); @@ -249,12 +247,11 @@ static int method_activate_session(sd_bus *bus, sd_bus_message *message, void *u return sd_bus_reply_method_return(message, NULL); } -static int method_switch_to(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_switch_to(sd_bus_message *message, void *userdata, sd_bus_error *error) { Seat *s = userdata; unsigned int to; int r; - assert(bus); assert(message); assert(s); @@ -272,11 +269,10 @@ static int method_switch_to(sd_bus *bus, sd_bus_message *message, void *userdata return sd_bus_reply_method_return(message, NULL); } -static int method_switch_to_next(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_switch_to_next(sd_bus_message *message, void *userdata, sd_bus_error *error) { Seat *s = userdata; int r; - assert(bus); assert(message); assert(s); @@ -287,11 +283,10 @@ static int method_switch_to_next(sd_bus *bus, sd_bus_message *message, void *use return sd_bus_reply_method_return(message, NULL); } -static int method_switch_to_previous(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_switch_to_previous(sd_bus_message *message, void *userdata, sd_bus_error *error) { Seat *s = userdata; int r; - assert(bus); assert(message); assert(s); diff --git a/src/login/logind-seat.h b/src/login/logind-seat.h index 2a0f574be6..248dbeb9d7 100644 --- a/src/login/logind-seat.h +++ b/src/login/logind-seat.h @@ -94,4 +94,4 @@ char *seat_bus_path(Seat *s); int seat_send_signal(Seat *s, bool new_seat); int seat_send_changed(Seat *s, const char *properties, ...) _sentinel_; -int bus_seat_method_terminate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_seat_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error); diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c index b119c8321b..debaa31a29 100644 --- a/src/login/logind-session-dbus.c +++ b/src/login/logind-session-dbus.c @@ -180,11 +180,10 @@ static int property_get_idle_since_hint( return sd_bus_message_append(reply, "t", u); } -int bus_session_method_terminate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int bus_session_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error) { Session *s = userdata; int r; - assert(bus); assert(message); assert(s); @@ -208,11 +207,10 @@ int bus_session_method_terminate(sd_bus *bus, sd_bus_message *message, void *use return sd_bus_reply_method_return(message, NULL); } -int bus_session_method_activate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int bus_session_method_activate(sd_bus_message *message, void *userdata, sd_bus_error *error) { Session *s = userdata; int r; - assert(bus); assert(message); assert(s); @@ -223,11 +221,10 @@ int bus_session_method_activate(sd_bus *bus, sd_bus_message *message, void *user return sd_bus_reply_method_return(message, NULL); } -int bus_session_method_lock(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int bus_session_method_lock(sd_bus_message *message, void *userdata, sd_bus_error *error) { Session *s = userdata; int r; - assert(bus); assert(message); assert(s); @@ -251,13 +248,12 @@ int bus_session_method_lock(sd_bus *bus, sd_bus_message *message, void *userdata return sd_bus_reply_method_return(message, NULL); } -static int method_set_idle_hint(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_set_idle_hint(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; Session *s = userdata; uid_t uid; int r, b; - assert(bus); assert(message); assert(s); @@ -281,14 +277,13 @@ static int method_set_idle_hint(sd_bus *bus, sd_bus_message *message, void *user return sd_bus_reply_method_return(message, NULL); } -int bus_session_method_kill(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int bus_session_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *error) { Session *s = userdata; const char *swho; int32_t signo; KillWho who; int r; - assert(bus); assert(message); assert(s); @@ -327,13 +322,12 @@ int bus_session_method_kill(sd_bus *bus, sd_bus_message *message, void *userdata return sd_bus_reply_method_return(message, NULL); } -static int method_take_control(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_take_control(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; Session *s = userdata; int r, force; uid_t uid; - assert(bus); assert(message); assert(s); @@ -359,10 +353,9 @@ static int method_take_control(sd_bus *bus, sd_bus_message *message, void *userd return sd_bus_reply_method_return(message, NULL); } -static int method_release_control(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_release_control(sd_bus_message *message, void *userdata, sd_bus_error *error) { Session *s = userdata; - assert(bus); assert(message); assert(s); @@ -374,14 +367,13 @@ static int method_release_control(sd_bus *bus, sd_bus_message *message, void *us return sd_bus_reply_method_return(message, NULL); } -static int method_take_device(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_take_device(sd_bus_message *message, void *userdata, sd_bus_error *error) { Session *s = userdata; uint32_t major, minor; SessionDevice *sd; dev_t dev; int r; - assert(bus); assert(message); assert(s); @@ -413,14 +405,13 @@ static int method_take_device(sd_bus *bus, sd_bus_message *message, void *userda return r; } -static int method_release_device(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_release_device(sd_bus_message *message, void *userdata, sd_bus_error *error) { Session *s = userdata; uint32_t major, minor; SessionDevice *sd; dev_t dev; int r; - assert(bus); assert(message); assert(s); @@ -440,14 +431,13 @@ static int method_release_device(sd_bus *bus, sd_bus_message *message, void *use return sd_bus_reply_method_return(message, NULL); } -static int method_pause_device_complete(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +static int method_pause_device_complete(sd_bus_message *message, void *userdata, sd_bus_error *error) { Session *s = userdata; uint32_t major, minor; SessionDevice *sd; dev_t dev; int r; - assert(bus); assert(message); assert(s); diff --git a/src/login/logind-session.h b/src/login/logind-session.h index 9305dca83f..7a329b94ad 100644 --- a/src/login/logind-session.h +++ b/src/login/logind-session.h @@ -176,7 +176,7 @@ bool session_is_controller(Session *s, const char *sender); int session_set_controller(Session *s, const char *sender, bool force); void session_drop_controller(Session *s); -int bus_session_method_activate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int bus_session_method_lock(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int bus_session_method_terminate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int bus_session_method_kill(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_session_method_activate(sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_session_method_lock(sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_session_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_session_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *error); diff --git a/src/login/logind-user-dbus.c b/src/login/logind-user-dbus.c index 03c33708fc..8a710cef13 100644 --- a/src/login/logind-user-dbus.c +++ b/src/login/logind-user-dbus.c @@ -172,11 +172,10 @@ static int property_get_linger( return sd_bus_message_append(reply, "b", r > 0); } -int bus_user_method_terminate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int bus_user_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error) { User *u = userdata; int r; - assert(bus); assert(message); assert(u); @@ -200,12 +199,11 @@ int bus_user_method_terminate(sd_bus *bus, sd_bus_message *message, void *userda return sd_bus_reply_method_return(message, NULL); } -int bus_user_method_kill(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +int bus_user_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *error) { User *u = userdata; int32_t signo; int r; - assert(bus); assert(message); assert(u); diff --git a/src/login/logind-user.h b/src/login/logind-user.h index be5b56883c..722247806b 100644 --- a/src/login/logind-user.h +++ b/src/login/logind-user.h @@ -91,5 +91,5 @@ int user_send_changed(User *u, const char *properties, ...) _sentinel_; const char* user_state_to_string(UserState s) _const_; UserState user_state_from_string(const char *s) _pure_; -int bus_user_method_terminate(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int bus_user_method_kill(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_user_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error); +int bus_user_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *error); diff --git a/src/login/logind.h b/src/login/logind.h index 56c05b850c..cd226f55fc 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -162,11 +162,11 @@ bool manager_is_docked_or_multiple_displays(Manager *m); extern const sd_bus_vtable manager_vtable[]; -int match_job_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_unit_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_reloading(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_name_owner_changed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); +int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *error); +int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *error); +int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error); +int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error); +int match_name_owner_changed(sd_bus_message *message, void *userdata, sd_bus_error *error); int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit_name, InhibitWhat w, sd_bus_error *error); |