summaryrefslogtreecommitdiff
path: root/src/login/logind-session-dbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/logind-session-dbus.c')
-rw-r--r--src/login/logind-session-dbus.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
index cebdfe311a..bf4cccbd17 100644
--- a/src/login/logind-session-dbus.c
+++ b/src/login/logind-session-dbus.c
@@ -189,9 +189,9 @@ static int method_terminate(sd_bus *bus, sd_bus_message *message, void *userdata
r = session_stop(s);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
- return sd_bus_reply_method_return(bus, message, NULL);
+ return sd_bus_reply_method_return(message, NULL);
}
static int method_activate(sd_bus *bus, sd_bus_message *message, void *userdata) {
@@ -204,9 +204,9 @@ static int method_activate(sd_bus *bus, sd_bus_message *message, void *userdata)
r = session_activate(s);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
- return sd_bus_reply_method_return(bus, message, NULL);
+ return sd_bus_reply_method_return(message, NULL);
}
static int method_lock(sd_bus *bus, sd_bus_message *message, void *userdata) {
@@ -219,9 +219,9 @@ static int method_lock(sd_bus *bus, sd_bus_message *message, void *userdata) {
r = session_send_lock(s, streq(sd_bus_message_get_member(message), "Lock"));
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
- return sd_bus_reply_method_return(bus, message, NULL);
+ return sd_bus_reply_method_return(message, NULL);
}
static int method_set_idle_hint(sd_bus *bus, sd_bus_message *message, void *userdata) {
@@ -235,18 +235,18 @@ static int method_set_idle_hint(sd_bus *bus, sd_bus_message *message, void *user
r = sd_bus_message_read(message, "b", &b);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
r = sd_bus_get_owner_uid(bus, sd_bus_message_get_sender(message), &uid);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
if (uid != 0 && uid != s->user->uid)
- return sd_bus_reply_method_errorf(bus, message, SD_BUS_ERROR_ACCESS_DENIED, "Only owner of session my set idle hint");
+ return sd_bus_reply_method_errorf(message, SD_BUS_ERROR_ACCESS_DENIED, "Only owner of session my set idle hint");
session_set_idle_hint(s, b);
- return sd_bus_reply_method_return(bus, message, NULL);
+ return sd_bus_reply_method_return(message, NULL);
}
static int method_kill(sd_bus *bus, sd_bus_message *message, void *userdata) {
@@ -262,24 +262,24 @@ static int method_kill(sd_bus *bus, sd_bus_message *message, void *userdata) {
r = sd_bus_message_read(message, "si", &swho, &signo);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
if (isempty(swho))
who = KILL_ALL;
else {
who = kill_who_from_string(swho);
if (who < 0)
- return sd_bus_reply_method_errorf(bus, message, SD_BUS_ERROR_INVALID_ARGS, "Invalid kill parameter '%s'", swho);
+ return sd_bus_reply_method_errorf(message, SD_BUS_ERROR_INVALID_ARGS, "Invalid kill parameter '%s'", swho);
}
if (signo <= 0 || signo >= _NSIG)
- return sd_bus_reply_method_errorf(bus, message, SD_BUS_ERROR_INVALID_ARGS, "Invalid signal %i", signo);
+ return sd_bus_reply_method_errorf(message, SD_BUS_ERROR_INVALID_ARGS, "Invalid signal %i", signo);
r = session_kill(s, who, signo);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
- return sd_bus_reply_method_return(bus, message, NULL);
+ return sd_bus_reply_method_return(message, NULL);
}
static int method_take_control(sd_bus *bus, sd_bus_message *message, void *userdata) {
@@ -293,20 +293,20 @@ static int method_take_control(sd_bus *bus, sd_bus_message *message, void *userd
r = sd_bus_message_read(message, "b", &force);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
r = sd_bus_get_owner_uid(bus, sd_bus_message_get_sender(message), &uid);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
if (uid != 0 && (force || uid != s->user->uid))
- return sd_bus_reply_method_errorf(bus, message, SD_BUS_ERROR_ACCESS_DENIED, "Only owner of session may take control");
+ return sd_bus_reply_method_errorf(message, SD_BUS_ERROR_ACCESS_DENIED, "Only owner of session may take control");
r = session_set_controller(s, sd_bus_message_get_sender(message), force);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
- return sd_bus_reply_method_return(bus, message, NULL);
+ return sd_bus_reply_method_return(message, NULL);
}
static int method_release_control(sd_bus *bus, sd_bus_message *message, void *userdata) {
@@ -317,11 +317,11 @@ static int method_release_control(sd_bus *bus, sd_bus_message *message, void *us
assert(s);
if (!session_is_controller(s, sd_bus_message_get_sender(message)))
- return sd_bus_reply_method_errorf(bus, message, BUS_ERROR_NOT_IN_CONTROL, "You are not in control of this session");
+ return sd_bus_reply_method_errorf(message, BUS_ERROR_NOT_IN_CONTROL, "You are not in control of this session");
session_drop_controller(s);
- return sd_bus_reply_method_return(bus, message, NULL);
+ return sd_bus_reply_method_return(message, NULL);
}
static int method_take_device(sd_bus *bus, sd_bus_message *message, void *userdata) {
@@ -337,10 +337,10 @@ static int method_take_device(sd_bus *bus, sd_bus_message *message, void *userda
r = sd_bus_message_read(message, "uu", &major, &minor);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
if (!session_is_controller(s, sd_bus_message_get_sender(message)))
- return sd_bus_reply_method_errorf(bus, message, BUS_ERROR_NOT_IN_CONTROL, "You are not in control of this session");
+ return sd_bus_reply_method_errorf(message, BUS_ERROR_NOT_IN_CONTROL, "You are not in control of this session");
dev = makedev(major, minor);
sd = hashmap_get(s->devices, &dev);
@@ -350,13 +350,13 @@ static int method_take_device(sd_bus *bus, sd_bus_message *message, void *userda
* The caller should use dup() if it requires more
* than one fd (it would be functionally
* equivalent). */
- return sd_bus_reply_method_errorf(bus, message, BUS_ERROR_DEVICE_IS_TAKEN, "Device already taken");
+ return sd_bus_reply_method_errorf(message, BUS_ERROR_DEVICE_IS_TAKEN, "Device already taken");
r = session_device_new(s, dev, &sd);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
- r = sd_bus_reply_method_return(bus, message, "hb", sd->fd, !sd->active);
+ r = sd_bus_reply_method_return(message, "hb", sd->fd, !sd->active);
if (r < 0)
session_device_free(sd);
@@ -376,18 +376,18 @@ static int method_release_device(sd_bus *bus, sd_bus_message *message, void *use
r = sd_bus_message_read(message, "uu", &major, &minor);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
if (!session_is_controller(s, sd_bus_message_get_sender(message)))
- return sd_bus_reply_method_errorf(bus, message, BUS_ERROR_NOT_IN_CONTROL, "You are not in control of this session");
+ return sd_bus_reply_method_errorf(message, BUS_ERROR_NOT_IN_CONTROL, "You are not in control of this session");
dev = makedev(major, minor);
sd = hashmap_get(s->devices, &dev);
if (!sd)
- return sd_bus_reply_method_errorf(bus, message, BUS_ERROR_DEVICE_NOT_TAKEN, "Device not taken");
+ return sd_bus_reply_method_errorf(message, BUS_ERROR_DEVICE_NOT_TAKEN, "Device not taken");
session_device_free(sd);
- return sd_bus_reply_method_return(bus, message, NULL);
+ return sd_bus_reply_method_return(message, NULL);
}
static int method_pause_device_complete(sd_bus *bus, sd_bus_message *message, void *userdata) {
@@ -403,19 +403,19 @@ static int method_pause_device_complete(sd_bus *bus, sd_bus_message *message, vo
r = sd_bus_message_read(message, "uu", &major, &minor);
if (r < 0)
- return sd_bus_reply_method_errno(bus, message, r, NULL);
+ return sd_bus_reply_method_errno(message, r, NULL);
if (!session_is_controller(s, sd_bus_message_get_sender(message)))
- return sd_bus_reply_method_errorf(bus, message, BUS_ERROR_NOT_IN_CONTROL, "You are not in control of this session");
+ return sd_bus_reply_method_errorf(message, BUS_ERROR_NOT_IN_CONTROL, "You are not in control of this session");
dev = makedev(major, minor);
sd = hashmap_get(s->devices, &dev);
if (!sd)
- return sd_bus_reply_method_errorf(bus, message, BUS_ERROR_DEVICE_NOT_TAKEN, "Device not taken");
+ return sd_bus_reply_method_errorf(message, BUS_ERROR_DEVICE_NOT_TAKEN, "Device not taken");
session_device_complete_pause(sd);
- return sd_bus_reply_method_return(bus, message, NULL);
+ return sd_bus_reply_method_return(message, NULL);
}
const sd_bus_vtable session_vtable[] = {
@@ -643,7 +643,7 @@ int session_send_create_reply(Session *s, sd_bus_error *error) {
s->create_message = NULL;
if (error)
- return sd_bus_reply_method_error(s->manager->bus, c, error);
+ return sd_bus_reply_method_error(c, error);
fifo_fd = session_create_fifo(s);
if (fifo_fd < 0)
@@ -667,7 +667,7 @@ int session_send_create_reply(Session *s, sd_bus_error *error) {
(uint32_t) s->vtnr);
return sd_bus_reply_method_return(
- s->manager->bus, c,
+ c,
"soshsub",
s->id,
p,