summaryrefslogtreecommitdiff
path: root/runit/svlogd.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-09-30 23:50:48 +0000
committerDenis Vlasenko2007-09-30 23:50:48 +0000
commit96e1b38586e80a0f014038bf4fdf4689c668fbd6 (patch)
treed7f6a7866700601598cfcc006b7dcb6cb4a7c07e /runit/svlogd.c
parentdeabacdf91c6d1c3cfcdb4cd06780807193de81d (diff)
downloadbusybox-96e1b38586e80a0f014038bf4fdf4689c668fbd6.zip
busybox-96e1b38586e80a0f014038bf4fdf4689c668fbd6.tar.gz
introduce and use close_on_exec_on(fd). -50 bytes.
Diffstat (limited to 'runit/svlogd.c')
-rw-r--r--runit/svlogd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/runit/svlogd.c b/runit/svlogd.c
index b5eed15..cdf4e42 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -361,7 +361,7 @@ static unsigned rotate(struct logdir *ld)
/* we presume this cannot fail */
ld->filecur = fdopen(ld->fdcur, "a"); ////
setvbuf(ld->filecur, NULL, _IOFBF, linelen); ////
- coe(ld->fdcur);
+ close_on_exec_on(ld->fdcur);
ld->size = 0;
while (fchmod(ld->fdcur, 0644) == -1)
pause2cannot("set mode of current", ld->name);
@@ -482,7 +482,7 @@ static unsigned logdir_open(struct logdir *ld, const char *fn)
warn2("cannot open log directory", (char*)fn);
return 0;
}
- coe(ld->fddir);
+ close_on_exec_on(ld->fddir);
if (fchdir(ld->fddir) == -1) {
logdir_close(ld);
warn2("cannot change directory", (char*)fn);
@@ -498,7 +498,7 @@ static unsigned logdir_open(struct logdir *ld, const char *fn)
pause1cannot("change to initial working directory");
return 0;
}
- coe(ld->fdlock);
+ close_on_exec_on(ld->fdlock);
ld->size = 0;
ld->sizemax = 1000000;
@@ -624,7 +624,7 @@ static unsigned logdir_open(struct logdir *ld, const char *fn)
ld->filecur = fdopen(ld->fdcur, "a"); ////
setvbuf(ld->filecur, NULL, _IOFBF, linelen); ////
- coe(ld->fdcur);
+ close_on_exec_on(ld->fdcur);
while (fchmod(ld->fdcur, 0644) == -1)
pause2cannot("set mode of current", ld->name);
@@ -851,7 +851,7 @@ int svlogd_main(int argc, char **argv)
if (dirn <= 0) usage();
////if (buflen <= linemax) usage();
fdwdir = xopen(".", O_RDONLY|O_NDELAY);
- coe(fdwdir);
+ close_on_exec_on(fdwdir);
dir = xzalloc(dirn * sizeof(struct logdir));
for (i = 0; i < dirn; ++i) {
dir[i].fddir = -1;