#include "dbus-path.h"
#include "special.h"
#include "bus-errors.h"
+#include "path-util.h"
static const UnitActiveState state_translation_table[_PATH_STATE_MAX] = {
[PATH_DEAD] = UNIT_INACTIVE,
goto fail;
}
- if ((s->primary_wd = inotify_add_watch(s->inotify_fd, k, flags_table[s->type])) >= 0)
+ s->primary_wd = inotify_add_watch(s->inotify_fd, k, flags_table[s->type]);
+ if (s->primary_wd >= 0)
exists = true;
do {
int flags;
/* This assumes the path was passed through path_kill_slashes()! */
- if (!(slash = strrchr(k, '/')))
+ slash = strrchr(k, '/');
+ if (!slash)
break;
/* Trim the path at the last slash. Keep the slash if it's the root dir. */
if (s->type == PATH_EXISTS || s->type == PATH_EXISTS_GLOB)
return;
- if ((r = mkdir_p(s->path, mode)) < 0)
+ if ((r = mkdir_p_label(s->path, mode)) < 0)
log_warning("mkdir(%s) failed: %s", s->path, strerror(-r));
}
assert(p);
- if (UNIT(p)->manager->running_as == MANAGER_SYSTEM) {
+ if (UNIT(p)->manager->running_as == SYSTEMD_SYSTEM) {
if ((r = unit_add_dependency_by_name(UNIT(p), UNIT_BEFORE, SPECIAL_BASIC_TARGET, NULL, true)) < 0)
return r;
DEFINE_STRING_TABLE_LOOKUP(path_result, PathResult);
const UnitVTable path_vtable = {
- .suffix = ".path",
.object_size = sizeof(Path),
.sections =
"Unit\0"