aboutsummaryrefslogtreecommitdiff
path: root/runit/sv.c
diff options
context:
space:
mode:
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