Commit 282238dd authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_relocate_fd): Implemented for real.

parent d69e73af
......@@ -10,6 +10,8 @@
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <unistd.h>
#include "isc.h"
......@@ -19,9 +21,15 @@ int
isc_relocate_fd(int fd,
int limit)
{
if (limit == 0)
int high_fd;
if (limit <= 0)
return fd;
high_fd = fcntl(fd, F_DUPFD, limit);
if (high_fd < 0)
return fd;
/* FIXME: magic ioctl here */
return fd;
close(fd);
return high_fd;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment