summaryrefslogtreecommitdiff
path: root/src/core/killall.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-01 10:26:50 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-01 10:26:50 -0500
commita6c59096650be6653eb0b3590fb4ea3292337e6a (patch)
tree7e8d1d9ff89f50266c222e9fafd86d97a2542ce6 /src/core/killall.c
parent785d345145bbd06c8f1c75c6a0b119c4e8f411db (diff)
Revert "Trivial typo fixes and code refactorings (#5191)"
Let's do a merge to preserve all the commit messages. This reverts commit 785d345145bbd06c8f1c75c6a0b119c4e8f411db.
Diffstat (limited to 'src/core/killall.c')
-rw-r--r--src/core/killall.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/core/killall.c b/src/core/killall.c
index 7a9df546ee..b3aa22adc5 100644
--- a/src/core/killall.c
+++ b/src/core/killall.c
@@ -66,26 +66,29 @@ static bool ignore_proc(pid_t pid, bool warn_rootfs) {
if (count <= 0)
return true;
- /* Processes with argv[0][0] = '@' we ignore from the killing spree.
+ /* Processes with argv[0][0] = '@' we ignore from the killing
+ * spree.
*
* http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons */
- if (c != '@')
- return false;
-
- if (warn_rootfs &&
- pid_from_same_root_fs(pid) == 0) {
-
+ if (c == '@' && warn_rootfs) {
_cleanup_free_ char *comm = NULL;
+ r = pid_from_same_root_fs(pid);
+ if (r < 0)
+ return true;
+
get_process_comm(pid, &comm);
- log_notice("Process " PID_FMT " (%s) has been marked to be excluded from killing. It is "
- "running from the root file system, and thus likely to block re-mounting of the "
- "root file system to read-only. Please consider moving it into an initrd file "
- "system instead.", pid, strna(comm));
- }
+ if (r)
+ log_notice("Process " PID_FMT " (%s) has been marked to be excluded from killing. It is "
+ "running from the root file system, and thus likely to block re-mounting of the "
+ "root file system to read-only. Please consider moving it into an initrd file "
+ "system instead.", pid, strna(comm));
+ return true;
+ } else if (c == '@')
+ return true;
- return true;
+ return false;
}
static void wait_for_children(Set *pids, sigset_t *mask) {