aboutsummaryrefslogtreecommitdiff
path: root/runit/sv.c
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-10-13 12:53:27 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-10-13 12:53:27 +0200
commit05e8605ab8a01120af7c9f011c2334ab34381fdf (patch)
treef200589bc4e66c649788cc58d5a6f4fc013dbe45 /runit/sv.c
parentb1db09be5a19f814ed5dc7e0ab095c3355926da6 (diff)
downloadbusybox-w32-05e8605ab8a01120af7c9f011c2334ab34381fdf.tar.gz
busybox-w32-05e8605ab8a01120af7c9f011c2334ab34381fdf.tar.bz2
busybox-w32-05e8605ab8a01120af7c9f011c2334ab34381fdf.zip
remove runit/runit_lib.c
function old new delta runsv_main 1770 1786 +16 svstatus_get 176 188 +12 sv_main 1180 1186 +6 runsvdir_main 683 689 +6 processorstart 385 391 +6 control 126 132 +6 logdir_open 1184 1187 +3 lock_exnb 14 - -14 lock_ex 14 - -14 open_write 17 - -17 open_read 17 - -17 ------------------------------------------------------------------------------ (add/remove: 0/5 grow/shrink: 7/0 up/down: 55/-62) Total: -7 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'runit/sv.c')
-rw-r--r--runit/sv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/runit/sv.c b/runit/sv.c
index 3f76a2d47..c420a91a6 100644
--- a/runit/sv.c
+++ b/runit/sv.c
@@ -176,6 +176,9 @@ struct globals {
176#define INIT_G() do { } while (0) 176#define INIT_G() do { } while (0)
177 177
178 178
179#define str_equal(s,t) (!strcmp((s), (t)))
180
181
179static void fatal_cannot(const char *m1) NORETURN; 182static void fatal_cannot(const char *m1) NORETURN;
180static void fatal_cannot(const char *m1) 183static void fatal_cannot(const char *m1)
181{ 184{
@@ -221,7 +224,7 @@ static int svstatus_get(void)
221{ 224{
222 int fd, r; 225 int fd, r;
223 226
224 fd = open_write("supervise/ok"); 227 fd = open("supervise/ok", O_WRONLY|O_NDELAY);
225 if (fd == -1) { 228 if (fd == -1) {
226 if (errno == ENODEV) { 229 if (errno == ENODEV) {
227 *acts == 'x' ? ok("runsv not running") 230 *acts == 'x' ? ok("runsv not running")
@@ -232,7 +235,7 @@ static int svstatus_get(void)
232 return -1; 235 return -1;
233 } 236 }
234 close(fd); 237 close(fd);
235 fd = open_read("supervise/status"); 238 fd = open("supervise/status", O_RDONLY|O_NDELAY);
236 if (fd == -1) { 239 if (fd == -1) {
237 warn("can't open supervise/status"); 240 warn("can't open supervise/status");
238 return -1; 241 return -1;
@@ -397,7 +400,7 @@ static int control(const char *a)
397 if (svstatus.want == *a) 400 if (svstatus.want == *a)
398 return 0; 401 return 0;
399*/ 402*/
400 fd = open_write("supervise/control"); 403 fd = open("supervise/control", O_WRONLY|O_NDELAY);
401 if (fd == -1) { 404 if (fd == -1) {
402 if (errno != ENODEV) 405 if (errno != ENODEV)
403 warn("can't open supervise/control"); 406 warn("can't open supervise/control");
@@ -446,7 +449,7 @@ int sv_main(int argc UNUSED_PARAM, char **argv)
446 449
447 tnow = time(NULL) + 0x400000000000000aULL; 450 tnow = time(NULL) + 0x400000000000000aULL;
448 tstart = tnow; 451 tstart = tnow;
449 curdir = open_read("."); 452 curdir = open(".", O_RDONLY|O_NDELAY);
450 if (curdir == -1) 453 if (curdir == -1)
451 fatal_cannot("open current directory"); 454 fatal_cannot("open current directory");
452 455