diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-30 23:50:48 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-30 23:50:48 +0000 |
commit | 96e1b38586e80a0f014038bf4fdf4689c668fbd6 (patch) | |
tree | d7f6a7866700601598cfcc006b7dcb6cb4a7c07e /runit/runsv.c | |
parent | deabacdf91c6d1c3cfcdb4cd06780807193de81d (diff) | |
download | busybox-w32-96e1b38586e80a0f014038bf4fdf4689c668fbd6.tar.gz busybox-w32-96e1b38586e80a0f014038bf4fdf4689c668fbd6.tar.bz2 busybox-w32-96e1b38586e80a0f014038bf4fdf4689c668fbd6.zip |
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) | |||
454 | dir = argv[1]; | 454 | dir = argv[1]; |
455 | 455 | ||
456 | xpipe(selfpipe); | 456 | xpipe(selfpipe); |
457 | coe(selfpipe[0]); | 457 | close_on_exec_on(selfpipe[0]); |
458 | coe(selfpipe[1]); | 458 | close_on_exec_on(selfpipe[1]); |
459 | ndelay_on(selfpipe[0]); | 459 | ndelay_on(selfpipe[0]); |
460 | ndelay_on(selfpipe[1]); | 460 | ndelay_on(selfpipe[1]); |
461 | 461 | ||
@@ -491,8 +491,8 @@ int runsv_main(int argc, char **argv) | |||
491 | if (stat("log/down", &s) != -1) | 491 | if (stat("log/down", &s) != -1) |
492 | svd[1].want = W_DOWN; | 492 | svd[1].want = W_DOWN; |
493 | xpipe(logpipe); | 493 | xpipe(logpipe); |
494 | coe(logpipe[0]); | 494 | close_on_exec_on(logpipe[0]); |
495 | coe(logpipe[1]); | 495 | close_on_exec_on(logpipe[1]); |
496 | } | 496 | } |
497 | } | 497 | } |
498 | 498 | ||
@@ -512,7 +512,7 @@ int runsv_main(int argc, char **argv) | |||
512 | O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600); | 512 | O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600); |
513 | if (lock_exnb(svd[0].fdlock) == -1) | 513 | if (lock_exnb(svd[0].fdlock) == -1) |
514 | fatal_cannot("lock supervise/lock"); | 514 | fatal_cannot("lock supervise/lock"); |
515 | coe(svd[0].fdlock); | 515 | close_on_exec_on(svd[0].fdlock); |
516 | if (haslog) { | 516 | if (haslog) { |
517 | if (mkdir("log/supervise", 0700) == -1) { | 517 | if (mkdir("log/supervise", 0700) == -1) { |
518 | r = readlink("log/supervise", buf, 256); | 518 | r = readlink("log/supervise", buf, 256); |
@@ -536,30 +536,30 @@ int runsv_main(int argc, char **argv) | |||
536 | O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600); | 536 | O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600); |
537 | if (lock_ex(svd[1].fdlock) == -1) | 537 | if (lock_ex(svd[1].fdlock) == -1) |
538 | fatal_cannot("lock log/supervise/lock"); | 538 | fatal_cannot("lock log/supervise/lock"); |
539 | coe(svd[1].fdlock); | 539 | close_on_exec_on(svd[1].fdlock); |
540 | } | 540 | } |
541 | 541 | ||
542 | mkfifo("log/supervise/control"+4, 0600); | 542 | mkfifo("log/supervise/control"+4, 0600); |
543 | svd[0].fdcontrol = xopen("log/supervise/control"+4, O_RDONLY|O_NDELAY); | 543 | svd[0].fdcontrol = xopen("log/supervise/control"+4, O_RDONLY|O_NDELAY); |
544 | coe(svd[0].fdcontrol); | 544 | close_on_exec_on(svd[0].fdcontrol); |
545 | svd[0].fdcontrolwrite = xopen("log/supervise/control"+4, O_WRONLY|O_NDELAY); | 545 | svd[0].fdcontrolwrite = xopen("log/supervise/control"+4, O_WRONLY|O_NDELAY); |
546 | coe(svd[0].fdcontrolwrite); | 546 | close_on_exec_on(svd[0].fdcontrolwrite); |
547 | update_status(&svd[0]); | 547 | update_status(&svd[0]); |
548 | if (haslog) { | 548 | if (haslog) { |
549 | mkfifo("log/supervise/control", 0600); | 549 | mkfifo("log/supervise/control", 0600); |
550 | svd[1].fdcontrol = xopen("log/supervise/control", O_RDONLY|O_NDELAY); | 550 | svd[1].fdcontrol = xopen("log/supervise/control", O_RDONLY|O_NDELAY); |
551 | coe(svd[1].fdcontrol); | 551 | close_on_exec_on(svd[1].fdcontrol); |
552 | svd[1].fdcontrolwrite = xopen("log/supervise/control", O_WRONLY|O_NDELAY); | 552 | svd[1].fdcontrolwrite = xopen("log/supervise/control", O_WRONLY|O_NDELAY); |
553 | coe(svd[1].fdcontrolwrite); | 553 | close_on_exec_on(svd[1].fdcontrolwrite); |
554 | update_status(&svd[1]); | 554 | update_status(&svd[1]); |
555 | } | 555 | } |
556 | mkfifo("log/supervise/ok"+4, 0600); | 556 | mkfifo("log/supervise/ok"+4, 0600); |
557 | fd = xopen("log/supervise/ok"+4, O_RDONLY|O_NDELAY); | 557 | fd = xopen("log/supervise/ok"+4, O_RDONLY|O_NDELAY); |
558 | coe(fd); | 558 | close_on_exec_on(fd); |
559 | if (haslog) { | 559 | if (haslog) { |
560 | mkfifo("log/supervise/ok", 0600); | 560 | mkfifo("log/supervise/ok", 0600); |
561 | fd = xopen("log/supervise/ok", O_RDONLY|O_NDELAY); | 561 | fd = xopen("log/supervise/ok", O_RDONLY|O_NDELAY); |
562 | coe(fd); | 562 | close_on_exec_on(fd); |
563 | } | 563 | } |
564 | for (;;) { | 564 | for (;;) { |
565 | struct pollfd x[3]; | 565 | struct pollfd x[3]; |