aboutsummaryrefslogtreecommitdiff
path: root/runit/runsv.c
diff options
context:
space:
mode:
authorGravatar Denys Vlasenko <dvlasenk@redhat.com>2010-10-13 12:53:27 +0200
committerGravatar Denys Vlasenko <dvlasenk@redhat.com>2010-10-13 12:53:27 +0200
commit05e8605ab8a01120af7c9f011c2334ab34381fdf (patch)
treef200589bc4e66c649788cc58d5a6f4fc013dbe45 /runit/runsv.c
parentb1db09be5a19f814ed5dc7e0ab095c3355926da6 (diff)
downloadbusybox-05e8605ab8a01120af7c9f011c2334ab34381fdf.tar.gz
busybox-05e8605ab8a01120af7c9f011c2334ab34381fdf.tar.bz2
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>
Diffstat (limited to 'runit/runsv.c')
-rw-r--r--runit/runsv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/runit/runsv.c b/runit/runsv.c
index 6bb6ec886..ebb031837 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -524,7 +524,7 @@ int runsv_main(int argc UNUSED_PARAM, char **argv)
}
svd[0].fdlock = xopen3("log/supervise/lock"+4,
O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600);
- if (lock_exnb(svd[0].fdlock) == -1)
+ if (flock(svd[0].fdlock, LOCK_EX | LOCK_NB) == -1)
fatal_cannot("lock supervise/lock");
close_on_exec_on(svd[0].fdlock);
if (haslog) {
@@ -548,7 +548,7 @@ int runsv_main(int argc UNUSED_PARAM, char **argv)
}
svd[1].fdlock = xopen3("log/supervise/lock",
O_WRONLY|O_NDELAY|O_APPEND|O_CREAT, 0600);
- if (lock_ex(svd[1].fdlock) == -1)
+ if (flock(svd[1].fdlock, LOCK_EX) == -1)
fatal_cannot("lock log/supervise/lock");
close_on_exec_on(svd[1].fdlock);
}
@@ -618,7 +618,7 @@ int runsv_main(int argc UNUSED_PARAM, char **argv)
pidchanged = 1;
svd[0].ctrl &= ~C_TERM;
if (svd[0].state != S_FINISH) {
- fd = open_read("finish");
+ fd = open("finish", O_RDONLY|O_NDELAY);
if (fd != -1) {
close(fd);
svd[0].state = S_FINISH;