summaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorDenis Vlasenko2009-02-26 12:38:01 +0000
committerDenis Vlasenko2009-02-26 12:38:01 +0000
commit31773b71e89f79cb5afda834ce15538a8818067d (patch)
tree009cd0ea5e3a6ef5c23accbf90573e7e784adc13 /runit
parentf09f4e015bffe6db5d7e63d47b23f22db4806736 (diff)
downloadbusybox-31773b71e89f79cb5afda834ce15538a8818067d.zip
busybox-31773b71e89f79cb5afda834ce15538a8818067d.tar.gz
runsv: another tiny optimization
function old new delta startservice 297 288 -9 ctrl 435 426 -9
Diffstat (limited to 'runit')
-rw-r--r--runit/runsv.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/runit/runsv.c b/runit/runsv.c
index 4155b8f..6d34dc1 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -304,15 +304,14 @@ static void stopservice(struct svdir *s)
static void startservice(struct svdir *s)
{
int p;
- char *run[2];
+ const char *run;
if (s->state == S_FINISH)
- run[0] = (char*)"./finish";
+ run = "./finish";
else {
- run[0] = (char*)"./run";
+ run = "./run";
custom(s, 'u');
}
- run[1] = NULL;
if (s->pid != 0)
stopservice(s); /* should never happen */
@@ -340,8 +339,8 @@ static void startservice(struct svdir *s)
, SIG_DFL);*/
sig_unblock(SIGCHLD);
sig_unblock(SIGTERM);
- execvp(*run, run);
- fatal2_cannot(s->islog ? "start log/" : "start ", *run);
+ execl(run, run, (char *) NULL);
+ fatal2_cannot(s->islog ? "start log/" : "start ", run);
}
/* parent */
if (s->state != S_FINISH) {
@@ -395,8 +394,7 @@ static int ctrl(struct svdir *s, char c)
case 'c': /* sig cont */
if (s->pid && !custom(s, c))
kill(s->pid, SIGCONT);
- if (s->ctrl & C_PAUSE)
- s->ctrl &= ~C_PAUSE;
+ s->ctrl &= ~C_PAUSE;
update_status(s);
break;
case 'o': /* once */