X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsystemctl.c;h=ab41566577167f3fe9997328197e831abd1ef496;hb=abebb5af9a7f5da77425aab1ecadd9bfcad53009;hp=a82cce4ae926d86f226943cd45bfe95976e7a303;hpb=78e39b43b89c6bf9ce401d6030939a004a23c850;p=elogind.git diff --git a/src/systemctl.c b/src/systemctl.c index a82cce4ae..ab4156657 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -3963,6 +3963,7 @@ static int create_symlink(const char *verb, const char *old_path, const char *ne return 1; } + free(dest); return 0; } @@ -4089,7 +4090,7 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo } if (!f) { -#if (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)) || defined(TARGET_MEEGO) && defined (HAVE_SYSV_COMPAT) +#if (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX)) && defined (HAVE_SYSV_COMPAT) if (endswith(i->name, ".service")) { char *sysv; @@ -4160,19 +4161,21 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo return -ENOENT; } + i->path = filename; + + if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) { + fclose(f); + return r; + } + /* Consider unit files stored in /lib and /usr always enabled * if they have no [Install] data. */ if (streq(verb, "is-enabled") && strv_isempty(i->aliases) && strv_isempty(i->wanted_by) && - !path_startswith(filename, "/etc")) - return 1; - - i->path = filename; - - if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) { + !path_startswith(filename, "/etc")) { fclose(f); - return r; + return 1; } n_symlinks += strv_length(i->aliases); @@ -5569,7 +5572,7 @@ static void pager_open(void) { if (!on_tty() || arg_no_pager) return; - if ((pager = getenv("PAGER"))) + if ((pager = getenv("SYSTEMD_PAGER")) || (pager = getenv("PAGER"))) if (!*pager || streq(pager, "cat")) return;