From 05e8605ab8a01120af7c9f011c2334ab34381fdf Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 13 Oct 2010 12:53:27 +0200 Subject: 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 --- runit/sv.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'runit/sv.c') 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 { #define INIT_G() do { } while (0) +#define str_equal(s,t) (!strcmp((s), (t))) + + static void fatal_cannot(const char *m1) NORETURN; static void fatal_cannot(const char *m1) { @@ -221,7 +224,7 @@ static int svstatus_get(void) { int fd, r; - fd = open_write("supervise/ok"); + fd = open("supervise/ok", O_WRONLY|O_NDELAY); if (fd == -1) { if (errno == ENODEV) { *acts == 'x' ? ok("runsv not running") @@ -232,7 +235,7 @@ static int svstatus_get(void) return -1; } close(fd); - fd = open_read("supervise/status"); + fd = open("supervise/status", O_RDONLY|O_NDELAY); if (fd == -1) { warn("can't open supervise/status"); return -1; @@ -397,7 +400,7 @@ static int control(const char *a) if (svstatus.want == *a) return 0; */ - fd = open_write("supervise/control"); + fd = open("supervise/control", O_WRONLY|O_NDELAY); if (fd == -1) { if (errno != ENODEV) warn("can't open supervise/control"); @@ -446,7 +449,7 @@ int sv_main(int argc UNUSED_PARAM, char **argv) tnow = time(NULL) + 0x400000000000000aULL; tstart = tnow; - curdir = open_read("."); + curdir = open(".", O_RDONLY|O_NDELAY); if (curdir == -1) fatal_cannot("open current directory"); -- cgit v1.2.3