chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
condition: properly allow passing back errors from condition checks
[elogind.git]
/
src
/
core
/
killall.c
diff --git
a/src/core/killall.c
b/src/core/killall.c
index 7664775142dbd2a98539eca12b8642d1fb17a419..a6ff50a5a4a56fdcdcbbedac17ecfc3d23d2f6c7 100644
(file)
--- a/
src/core/killall.c
+++ b/
src/core/killall.c
@@
-33,7
+33,8
@@
static bool ignore_proc(pid_t pid) {
_cleanup_fclose_ FILE *f = NULL;
static bool ignore_proc(pid_t pid) {
_cleanup_fclose_ FILE *f = NULL;
- char c, *p;
+ char c;
+ const char *p;
size_t count;
uid_t uid;
int r;
size_t count;
uid_t uid;
int r;
@@
-167,7
+168,7
@@
static int killall(int sig, Set *pids, bool send_sighup) {
continue;
if (sig == SIGKILL) {
continue;
if (sig == SIGKILL) {
- _cleanup_free_ char *s;
+ _cleanup_free_ char *s
= NULL
;
get_process_comm(pid, &s);
log_notice("Sending SIGKILL to PID "PID_FMT" (%s).", pid, strna(s));
get_process_comm(pid, &s);
log_notice("Sending SIGKILL to PID "PID_FMT" (%s).", pid, strna(s));
@@
-201,10
+202,10
@@
static int killall(int sig, Set *pids, bool send_sighup) {
void broadcast_signal(int sig, bool wait_for_exit, bool send_sighup) {
sigset_t mask, oldmask;
void broadcast_signal(int sig, bool wait_for_exit, bool send_sighup) {
sigset_t mask, oldmask;
- Set *pids = NULL;
+
_cleanup_set_free_
Set *pids = NULL;
if (wait_for_exit)
if (wait_for_exit)
- pids = set_new(
trivial_hash_func, trivial_compare_func
);
+ pids = set_new(
NULL
);
assert_se(sigemptyset(&mask) == 0);
assert_se(sigaddset(&mask, SIGCHLD) == 0);
assert_se(sigemptyset(&mask) == 0);
assert_se(sigaddset(&mask, SIGCHLD) == 0);
@@
-222,6
+223,4
@@
void broadcast_signal(int sig, bool wait_for_exit, bool send_sighup) {
wait_for_children(pids, &mask);
assert_se(sigprocmask(SIG_SETMASK, &oldmask, NULL) == 0);
wait_for_children(pids, &mask);
assert_se(sigprocmask(SIG_SETMASK, &oldmask, NULL) == 0);
-
- set_free(pids);
}
}