chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
logind: remove redundant check in manager_new()
[elogind.git]
/
src
/
login
/
logind-dbus.c
diff --git
a/src/login/logind-dbus.c
b/src/login/logind-dbus.c
index 28b5cd49a7a07bd497e522808814a704c0c1f9c3..bd0de33866c0a23ac3321bcdc77c59db8e25b67d 100644
(file)
--- a/
src/login/logind-dbus.c
+++ b/
src/login/logind-dbus.c
@@
-939,7
+939,7
@@
static int method_terminate_session(sd_bus *bus, sd_bus_message *message, void *
if (!session)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", name);
if (!session)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SESSION, "No session '%s' known", name);
- r = session_stop(session);
+ r = session_stop(session
, true
);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-964,7
+964,7
@@
static int method_terminate_user(sd_bus *bus, sd_bus_message *message, void *use
if (!user)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_USER, "No user '%lu' known or logged in", (unsigned long) uid);
if (!user)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_USER, "No user '%lu' known or logged in", (unsigned long) uid);
- r = user_stop(user);
+ r = user_stop(user
, true
);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-989,7
+989,7
@@
static int method_terminate_seat(sd_bus *bus, sd_bus_message *message, void *use
if (!seat)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SEAT, "No seat '%s' known", name);
if (!seat)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_SEAT, "No seat '%s' known", name);
- r = seat_stop_sessions(seat);
+ r = seat_stop_sessions(seat
, true
);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-2047,7
+2047,8
@@
int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdat
r = unit_name_from_dbus_path(path, &unit);
if (r < 0)
r = unit_name_from_dbus_path(path, &unit);
if (r < 0)
- return r;
+ /* quietly ignore non-units paths */
+ return r == -EINVAL ? 0 : r;
session = hashmap_get(m->session_units, unit);
if (session)
session = hashmap_get(m->session_units, unit);
if (session)
@@
-2178,7
+2179,7
@@
int manager_start_scope(
pid_t pid,
const char *slice,
const char *description,
pid_t pid,
const char *slice,
const char *description,
- const char *after,
+ const char *after,
const char *after2,
sd_bus_error *error,
char **job) {
sd_bus_error *error,
char **job) {
@@
-2219,12
+2220,18
@@
int manager_start_scope(
return r;
}
return r;
}
- if (!isempty(
description
)) {
+ if (!isempty(
after
)) {
r = sd_bus_message_append(m, "(sv)", "After", "as", 1, after);
if (r < 0)
return r;
}
r = sd_bus_message_append(m, "(sv)", "After", "as", 1, after);
if (r < 0)
return r;
}
+ if (!isempty(after2)) {
+ r = sd_bus_message_append(m, "(sv)", "After", "as", 1, after2);
+ if (r < 0)
+ return r;
+ }
+
/* cgroup empty notification is not available in containers
* currently. To make this less problematic, let's shorten the
* stop timeout for sessions, so that we don't wait
/* cgroup empty notification is not available in containers
* currently. To make this less problematic, let's shorten the
* stop timeout for sessions, so that we don't wait
@@
-2356,7
+2363,6
@@
int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, c
}
int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *error) {
}
int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *error) {
- _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
_cleanup_free_ char *path = NULL;
int r;
_cleanup_free_ char *path = NULL;
int r;
@@
-2378,7
+2384,8
@@
int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *err
NULL);
if (r < 0) {
if (sd_bus_error_has_name(error, BUS_ERROR_NO_SUCH_UNIT) ||
NULL);
if (r < 0) {
if (sd_bus_error_has_name(error, BUS_ERROR_NO_SUCH_UNIT) ||
- sd_bus_error_has_name(error, BUS_ERROR_LOAD_FAILED)) {
+ sd_bus_error_has_name(error, BUS_ERROR_LOAD_FAILED) ||
+ sd_bus_error_has_name(error, BUS_ERROR_SCOPE_NOT_RUNNING)) {
sd_bus_error_free(error);
return 0;
}
sd_bus_error_free(error);
return 0;
}