add NOMMU fixme's; move move_fd from runit_lib to libbb; nuke fd_copy
This commit is contained in:
@ -133,6 +133,16 @@ int ndelay_off(int fd)
|
||||
return fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0) & ~O_NONBLOCK);
|
||||
}
|
||||
|
||||
// "Renumber" opened fd
|
||||
void xmove_fd(int from, int to)
|
||||
{
|
||||
if (from == to)
|
||||
return;
|
||||
if (dup2(from, to) != to)
|
||||
bb_perror_msg_and_die("cannot duplicate file descriptor");
|
||||
close(from);
|
||||
}
|
||||
|
||||
// Die with an error message if we can't write the entire buffer.
|
||||
void xwrite(int fd, const void *buf, size_t count)
|
||||
{
|
||||
|
Reference in New Issue
Block a user