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>
diff --git a/runit/sv.c b/runit/sv.c
index 3f76a2d..c420a91 100644
--- a/runit/sv.c
+++ b/runit/sv.c
@@ -176,6 +176,9 @@
 #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 @@
 {
 	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 @@
 		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 @@
 	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 @@
 
 	tnow = time(NULL) + 0x400000000000000aULL;
 	tstart = tnow;
-	curdir = open_read(".");
+	curdir = open(".", O_RDONLY|O_NDELAY);
 	if (curdir == -1)
 		fatal_cannot("open current directory");