diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-06-09 23:51:57 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-06-09 23:51:57 +0200 |
commit | d93bcf29b82ee424ee9ec452c8b667fdd818a06b (patch) | |
tree | bcc675e7f7c668b4c57ec5aa234752b6719577f5 /src | |
parent | 135d5bfcaee87d5133f73333aaf4906499529d8f (diff) | |
parent | 60053efbbaabf084e1ecd61474fdc7235fe3da64 (diff) |
Merge pull request #126 from phomes/master
core: log oom during killing spree
Diffstat (limited to 'src')
-rw-r--r-- | src/core/killall.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/killall.c b/src/core/killall.c index 6e85923581..2a9d72c901 100644 --- a/src/core/killall.c +++ b/src/core/killall.c @@ -158,6 +158,7 @@ static int killall(int sig, Set *pids, bool send_sighup) { while ((d = readdir(dir))) { pid_t pid; + int r; if (d->d_type != DT_DIR && d->d_type != DT_UNKNOWN) @@ -177,8 +178,11 @@ static int killall(int sig, Set *pids, bool send_sighup) { } if (kill(pid, sig) >= 0) { - if (pids) - set_put(pids, ULONG_TO_PTR(pid)); + if (pids) { + r = set_put(pids, ULONG_TO_PTR(pid)); + if (r < 0) + log_oom(); + } } else if (errno != ENOENT) log_warning_errno(errno, "Could not kill %d: %m", pid); |