diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2017-08-25 11:36:45 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2017-08-25 11:36:45 -0500 |
commit | 36a0ab9054512ade413226fb8e8b28060045e9a4 (patch) | |
tree | 021d04ed222ddf7f28858104df2c2074514e1fb1 /src/rc/rc-schedules.c | |
parent | 27c2bd997d5173aa30844a16bc22dc8caab09f8c (diff) |
make run_stop_schedule accept a pid instead of a pid file
Diffstat (limited to 'src/rc/rc-schedules.c')
-rw-r--r-- | src/rc/rc-schedules.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/rc/rc-schedules.c b/src/rc/rc-schedules.c index 0390ef9c..7eb28372 100644 --- a/src/rc/rc-schedules.c +++ b/src/rc/rc-schedules.c @@ -297,7 +297,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, - const char *pidfile, uid_t uid, + pid_t pid, uid_t uid, bool test, bool progress) { SCHEDULEITEM *item = TAILQ_FIRST(&schedule); @@ -306,14 +306,13 @@ int run_stop_schedule(const char *applet, int nrunning = 0; long nloops, nsecs; struct timespec ts; - pid_t pid = 0; const char *const *p; bool progressed = false; if (exec) einfov("Will stop %s", exec); - if (pidfile) - einfov("Will stop PID in pidfile `%s'", pidfile); + if (pid > 0) + einfov("Will stop PID %d", pid); if (uid) einfov("Will stop processes owned by UID %d", uid); if (argv && *argv) { @@ -328,12 +327,6 @@ int run_stop_schedule(const char *applet, } } - if (pidfile) { - pid = get_pid(applet, pidfile); - if (pid == -1) - return 0; - } - while (item) { switch (item->type) { case SC_GOTO: |