svn commit: trunk/busybox/runit

vda at busybox.net vda at busybox.net
Thu Feb 26 12:38:02 UTC 2009


Author: vda
Date: 2009-02-26 12:38:01 +0000 (Thu, 26 Feb 2009)
New Revision: 25464

Log:
runsv: another tiny optimization

function                                             old     new   delta
startservice                                         297     288      -9
ctrl                                                 435     426      -9



Modified:
   trunk/busybox/runit/runsv.c


Changeset:
Modified: trunk/busybox/runit/runsv.c
===================================================================
--- trunk/busybox/runit/runsv.c	2009-02-26 12:29:59 UTC (rev 25463)
+++ trunk/busybox/runit/runsv.c	2009-02-26 12:38:01 UTC (rev 25464)
@@ -304,15 +304,14 @@
 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 @@
 			, 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 @@
 	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 */



More information about the busybox-cvs mailing list