summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-30 20:28:09 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-30 20:44:41 -0400
commit1058cbf2ad3d62d039f8f0be92d9d37777925a39 (patch)
tree3fdffa04f0eab31f9a075c6d5e0da5a02a1c8933 /src
parent76d5a71de99b6fe0ecc9bfd82ec641a5d408e191 (diff)
systemctl: suggest 'systemctl daemon-reload' without --system
--system is default anyway, and some poor user might type 9 characters without needing to.
Diffstat (limited to 'src')
-rw-r--r--src/core/manager.c3
-rw-r--r--src/shared/util.c8
-rw-r--r--src/systemctl/systemctl.c8
3 files changed, 10 insertions, 9 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index a7cfe57038..6b0f567663 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1037,7 +1037,8 @@ int manager_load_unit_prepare(Manager *m, const char *name, const char *path, DB
}
}
- if ((r = unit_add_name(ret, name)) < 0) {
+ r = unit_add_name(ret, name);
+ if (r < 0) {
unit_free(ret);
return r;
}
diff --git a/src/shared/util.c b/src/shared/util.c
index 673e0da6b6..2edf9cd875 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -850,18 +850,18 @@ int readlink_malloc(const char *p, char **r) {
}
int readlink_and_make_absolute(const char *p, char **r) {
- char *target, *k;
+ _cleanup_free_ char *target = NULL;
+ char *k;
int j;
assert(p);
assert(r);
- if ((j = readlink_malloc(p, &target)) < 0)
+ j = readlink_malloc(p, &target);
+ if (j < 0)
return j;
k = file_in_same_dir(p, target);
- free(target);
-
if (!k)
return -ENOMEM;
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 5ccbbbc0c7..6a4c2d6900 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1913,8 +1913,8 @@ static int start_unit_one(
}
if (need_daemon_reload(bus, n))
- log_warning("Warning: Unit file of %s changed on disk, 'systemctl %s daemon-reload' recommended.",
- n, arg_scope == UNIT_FILE_SYSTEM ? "--system" : "--user");
+ log_warning("Warning: Unit file of %s changed on disk, 'systemctl %sdaemon-reload' recommended.",
+ n, arg_scope == UNIT_FILE_SYSTEM ? "" : "--user ");
if (s) {
char *p;
@@ -2974,10 +2974,10 @@ static void print_status_info(UnitStatusInfo *i) {
}
if (i->need_daemon_reload)
- printf("\n%sWarning:%s Unit file changed on disk, 'systemctl %s daemon-reload' recommended.\n",
+ printf("\n%sWarning:%s Unit file changed on disk, 'systemctl %sdaemon-reload' recommended.\n",
ansi_highlight_red(true),
ansi_highlight_red(false),
- arg_scope == UNIT_FILE_SYSTEM ? "--system" : "--user");
+ arg_scope == UNIT_FILE_SYSTEM ? "" : "--user ");
}
static void show_unit_help(UnitStatusInfo *i) {