X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbasic%2Fprocess-util.c;h=c976f1f6891fda039fae84296acd91acba26aa2f;hp=c9115f85eff0630940c4ed167c333d0e7c58c6ed;hb=3835ce8528f80dc21606c6c01b90423ba317289b;hpb=fc5023c284153dba5a4b9c8eecc2147f9929899f diff --git a/src/basic/process-util.c b/src/basic/process-util.c index c9115f85e..c976f1f68 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -195,7 +195,7 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char * *(k++) = (char) c; left--; - } else if (k > r) + } else if (k > r) space = true; } @@ -631,8 +631,10 @@ int kill_and_sigcont(pid_t pid, int sig) { r = kill(pid, sig) < 0 ? -errno : 0; - if (r >= 0) - kill(pid, SIGCONT); + /* If this worked, also send SIGCONT, unless we already just sent a SIGCONT, or SIGKILL was sent which isn't + * affected by a process being suspended anyway. */ + if (r >= 0 && !IN_SET(SIGCONT, SIGKILL)) + (void) kill(pid, SIGCONT); return r; }