X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Funit.c;h=6458c7f5707c74a6e9914ed023dcecc8ef3d90cb;hb=6e8df5f00a3874decf1e5542da3d65b25f6da1dc;hp=50db86c42441727e54b81d45ce2e70b5a31e33c4;hpb=e821075a23fdfa3ca7738fc30bb2d4c430fe10c0;p=elogind.git diff --git a/src/core/unit.c b/src/core/unit.c index 50db86c42..6458c7f57 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1301,8 +1301,11 @@ int unit_reload(Unit *u) { if (state == UNIT_RELOADING) return -EALREADY; - if (state != UNIT_ACTIVE) + if (state != UNIT_ACTIVE) { + log_warning_unit(u->id, "Unit %s cannot be reloaded because it is inactive.", + u->id); return -ENOEXEC; + } following = unit_following(u); if (following) { @@ -1845,7 +1848,7 @@ static const char *resolve_template(Unit *u, const char *name, const char*path, assert(p); if (!name) - name = path_get_file_name(path); + name = basename(path); if (!unit_name_is_template(name)) { *p = NULL; @@ -2612,7 +2615,7 @@ UnitFileState unit_get_unit_file_state(Unit *u) { if (u->unit_file_state < 0 && u->fragment_path) u->unit_file_state = unit_file_get_state( u->manager->running_as == SYSTEMD_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER, - NULL, path_get_file_name(u->fragment_path)); + NULL, basename(u->fragment_path)); return u->unit_file_state; }