mirror of
https://github.com/systemd/systemd.git
synced 2024-12-25 01:34:28 +03:00
core: log oom during killing spree
but don't do anything else. We still want to kill as much as possible. Coverity CID#996306
This commit is contained in:
parent
135d5bfcae
commit
60053efbba
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user