projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
135d5bf
)
core: log oom during killing spree
author
Thomas Hindoe Paaboel Andersen
<phomes@gmail.com>
Tue, 9 Jun 2015 20:03:05 +0000
(22:03 +0200)
committer
Thomas Hindoe Paaboel Andersen
<phomes@gmail.com>
Tue, 9 Jun 2015 20:07:27 +0000
(22:07 +0200)
but don't do anything else. We still want to kill as much as
possible.
Coverity CID#996306
src/core/killall.c
patch
|
blob
|
history
diff --git
a/src/core/killall.c
b/src/core/killall.c
index
6e85923
..
2a9d72c
100644
(file)
--- 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);