add quiet parameter to run_stop_schedule
This commit is contained in:
parent
17b5cc78d3
commit
382efdbfcb
@ -298,7 +298,7 @@ int do_stop(const char *applet, const char *exec, const char *const *argv,
|
||||
int run_stop_schedule(const char *applet,
|
||||
const char *exec, const char *const *argv,
|
||||
pid_t pid, uid_t uid,
|
||||
bool test, bool progress)
|
||||
bool test, bool progress, bool quiet)
|
||||
{
|
||||
SCHEDULEITEM *item = TAILQ_FIRST(&schedule);
|
||||
int nkilled = 0;
|
||||
@ -409,6 +409,7 @@ int run_stop_schedule(const char *applet,
|
||||
|
||||
if (progressed)
|
||||
printf("\n");
|
||||
if (! quiet)
|
||||
if (nrunning == 1)
|
||||
eerror("%s: %d process refused to stop", applet, nrunning);
|
||||
else
|
||||
|
@ -22,6 +22,6 @@ int do_stop(const char *applet, const char *exec, const char *const *argv,
|
||||
int run_stop_schedule(const char *applet,
|
||||
const char *exec, const char *const *argv,
|
||||
pid_t pid, uid_t uid,
|
||||
bool test, bool progress);
|
||||
bool test, bool progress, bool quiet);
|
||||
|
||||
#endif
|
||||
|
@ -657,7 +657,7 @@ int main(int argc, char **argv)
|
||||
else
|
||||
parse_schedule(applet, NULL, sig);
|
||||
i = run_stop_schedule(applet, exec, (const char *const *)margv,
|
||||
get_pid(applet, pidfile), uid, test, progress);
|
||||
get_pid(applet, pidfile), uid, test, progress, false);
|
||||
|
||||
if (i < 0)
|
||||
/* We failed to stop something */
|
||||
|
@ -755,7 +755,7 @@ int main(int argc, char **argv)
|
||||
if (exiting) {
|
||||
syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid);
|
||||
nkilled = run_stop_schedule(applet, exec, NULL, child_pid,
|
||||
0, false, false);
|
||||
0, false, false, true);
|
||||
if (nkilled > 0)
|
||||
syslog(LOG_INFO, "killed %d processes", nkilled);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user