#include <string.h>
#include <unistd.h>
#include <pwd.h>
-#include <sys/capability.h>
#include "sd-id128.h"
#include "sd-messages.h"
#include "audit.h"
#include "bus-util.h"
#include "bus-error.h"
-#include "logind.h"
-#include "bus-errors.h"
+#include "bus-common-errors.h"
#include "udev-util.h"
+#include "selinux-util.h"
+#include "logind.h"
static int property_get_idle_hint(
sd_bus *bus,
/* Now, let's wait until the slice unit and stuff got
* created. We send the reply back from
- * session_send_create_reply().*/
+ * session_send_create_reply(). */
return 1;
d = opendir("/etc/udev/rules.d");
if (!d) {
if (errno != ENOENT)
- log_warning("Failed to open /etc/udev/rules.d: %m");
+ log_warning_errno(errno, "Failed to open /etc/udev/rules.d: %m");
} else {
struct dirent *de;
continue;
if (unlinkat(dirfd(d), de->d_name, 0) < 0)
- log_warning("Failed to unlink %s: %m", de->d_name);
+ log_warning_errno(errno, "Failed to unlink %s: %m", de->d_name);
}
}
q = NULL;
}
- return log_struct(LOG_NOTICE, MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
+ return log_struct(LOG_NOTICE,
+ LOG_MESSAGE_ID(SD_MESSAGE_SHUTDOWN),
p,
- q, NULL);
+ q,
+ NULL);
}
static int lid_switch_ignore_handler(sd_event_source *e, uint64_t usec, void *userdata) {
return 0;
r = unit_name_from_dbus_path(path, &unit);
+ if (r == -EINVAL) /* not a unit */
+ return 0;
if (r < 0)
- /* quietly ignore non-units paths */
- return r == -EINVAL ? 0 : r;
+ return r;
session = hashmap_get(m->session_units, unit);
if (session)