summaryrefslogtreecommitdiff
path: root/runit/svlogd.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-03-25 23:21:05 +0000
committerDenis Vlasenko2007-03-25 23:21:05 +0000
commitcad04ef4f3435e56181a81c896912543be34ea3c (patch)
tree71e46e02914c97077eaa77e12a726b29240b27f6 /runit/svlogd.c
parent10f8f5f4433a88b9cf9048d38a45838aa6e2abf6 (diff)
downloadbusybox-cad04ef4f3435e56181a81c896912543be34ea3c.zip
busybox-cad04ef4f3435e56181a81c896912543be34ea3c.tar.gz
add NOMMU fixme's; move move_fd from runit_lib to libbb; nuke fd_copy
Diffstat (limited to 'runit/svlogd.c')
-rw-r--r--runit/svlogd.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/runit/svlogd.c b/runit/svlogd.c
index e454bac..fb834a4 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -153,12 +153,10 @@ static unsigned processorstart(struct logdir *ld)
if (verbose)
bb_error_msg(INFO"processing: %s/%s", ld->name, ld->fnsave);
fd = xopen(ld->fnsave, O_RDONLY|O_NDELAY);
- if (fd_move(0, fd) == -1)
- bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
+ xmove_fd(fd, 0);
ld->fnsave[26] = 't';
fd = xopen(ld->fnsave, O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT);
- if (fd_move(1, fd) == -1)
- bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
+ xmove_fd(fd, 1);
fd = open_read("state");
if (fd == -1) {
if (errno != ENOENT)
@@ -166,17 +164,15 @@ static unsigned processorstart(struct logdir *ld)
close(xopen("state", O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT));
fd = xopen("state", O_RDONLY|O_NDELAY);
}
- if (fd_move(4, fd) == -1)
- bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
+ xmove_fd(fd, 4);
fd = xopen("newstate", O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT);
- if (fd_move(5, fd) == -1)
- bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
+ xmove_fd(fd, 5);
// getenv("SHELL")?
prog[0] = (char*)"sh";
prog[1] = (char*)"-c";
prog[2] = ld->processor;
- prog[3] = '\0';
+ prog[3] = NULL;
execve("/bin/sh", prog, environ);
bb_perror_msg_and_die(FATAL"cannot %s processor %s", "run", ld->name);
}