diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-01 03:50:48 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-01 03:50:48 +0400 |
commit | 96e1b38586e80a0f014038bf4fdf4689c668fbd6 (patch) | |
tree | d7f6a7866700601598cfcc006b7dcb6cb4a7c07e /runit/runsv.c | |
parent | deabacdf91c6d1c3cfcdb4cd06780807193de81d (diff) |
introduce and use close_on_exec_on(fd). -50 bytes.
Diffstat (limited to 'runit/runsv.c')
-rw-r--r-- | runit/runsv.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/runit/runsv.c b/runit/runsv.c index 1ee3dda01..7cf142d8a 100644 --- a/runit/runsv.c +++ b/runit/runsv.c @@ -454,8 +454,8 @@ int runsv_main(int argc, char **argv) dir = argv[1]; xpipe(selfpipe); - coe(selfpipe[0]); - coe(selfpipe[1]); + close_on_exec_on(selfpipe[0]); + close_on_exec_on(selfpipe[1]); ndelay_on(selfpipe[0]); ndelay_on(selfpipe[1]); @@ -491,8 +491,8 @@ int runsv_main(int argc, char **argv) if (stat("log/down", &s) != -1) svd[1].want = W_DOWN; xpipe(logpipe); - coe(logpipe[0]); - coe(logpipe[1]); + close_on_exec_on(logpipe[0]); + close_on_exec_on(logpipe[1]); } } @@ -512,7 +512,7 @@ int runsv_main(int argc, char **argv) O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600); if (lock_exnb(svd[0].fdlock) == -1) fatal_cannot("lock supervise/lock"); - coe(svd[0].fdlock); + close_on_exec_on(svd[0].fdlock); if (haslog) { if (mkdir("log/supervise", 0700) == -1) { r = readlink("log/supervise", buf, 256); @@ -536,30 +536,30 @@ int runsv_main(int argc, char **argv) O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600); if (lock_ex(svd[1].fdlock) == -1) fatal_cannot("lock log/supervise/lock"); - coe(svd[1].fdlock); + close_on_exec_on(svd[1].fdlock); } mkfifo("log/supervise/control"+4, 0600); svd[0].fdcontrol = xopen("log/supervise/control"+4, O_RDONLY|O_NDELAY); - coe(svd[0].fdcontrol); + close_on_exec_on(svd[0].fdcontrol); svd[0].fdcontrolwrite = xopen("log/supervise/control"+4, O_WRONLY|O_NDELAY); - coe(svd[0].fdcontrolwrite); + close_on_exec_on(svd[0].fdcontrolwrite); update_status(&svd[0]); if (haslog) { mkfifo("log/supervise/control", 0600); svd[1].fdcontrol = xopen("log/supervise/control", O_RDONLY|O_NDELAY); - coe(svd[1].fdcontrol); + close_on_exec_on(svd[1].fdcontrol); svd[1].fdcontrolwrite = xopen("log/supervise/control", O_WRONLY|O_NDELAY); - coe(svd[1].fdcontrolwrite); + close_on_exec_on(svd[1].fdcontrolwrite); update_status(&svd[1]); } mkfifo("log/supervise/ok"+4, 0600); fd = xopen("log/supervise/ok"+4, O_RDONLY|O_NDELAY); - coe(fd); + close_on_exec_on(fd); if (haslog) { mkfifo("log/supervise/ok", 0600); fd = xopen("log/supervise/ok", O_RDONLY|O_NDELAY); - coe(fd); + close_on_exec_on(fd); } for (;;) { struct pollfd x[3]; |