diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 01:27:11 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 09:43:06 -0700 |
commit | 512b6fb1c14d4c34f23a3419b0789ad01914a899 (patch) | |
tree | 29e51c256dde41db297cff28767bf4dc4a1dc73f /arch/um/os-Linux/drivers/tuntap_user.c | |
parent | b21d4b08b6686fa13bf9d4cae1ae08cb23ea3d53 (diff) |
uml: userspace files should call libc directly
A number of files that were changed in the recent removal of tt mode
are userspace files which call the os_* wrappers instead of calling
libc directly. A few other files were affected by this, through
This patch makes these call glibc directly.
There are also style fixes in the affected areas.
os_print_error has no remaining callers, so it is deleted.
There is a interface change to os_set_exec_close, eliminating a
parameter which was always the same. The callers are fixed as well.
os_process_pc got its error path cleaned up.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/drivers/tuntap_user.c')
-rw-r--r-- | arch/um/os-Linux/drivers/tuntap_user.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/um/os-Linux/drivers/tuntap_user.c b/arch/um/os-Linux/drivers/tuntap_user.c index f848b4ea934..72a2ff61556 100644 --- a/arch/um/os-Linux/drivers/tuntap_user.c +++ b/arch/um/os-Linux/drivers/tuntap_user.c @@ -62,7 +62,7 @@ static void tuntap_pre_exec(void *arg) struct tuntap_pre_exec_data *data = arg; dup2(data->stdout, 1); - os_close_file(data->close_me); + close(data->close_me); } static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote, @@ -88,7 +88,7 @@ static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote, if(pid < 0) return -pid; - os_close_file(remote); + close(remote); msg.msg_name = NULL; msg.msg_namelen = 0; @@ -125,7 +125,7 @@ static int tuntap_open_tramp(char *gate, int *fd_out, int me, int remote, return -EINVAL; } *fd_out = ((int *) CMSG_DATA(cmsg))[0]; - os_set_exec_close(*fd_out, 1); + os_set_exec_close(*fd_out); return 0; } @@ -154,20 +154,22 @@ static int tuntap_open(void *data) if(ioctl(pri->fd, TUNSETIFF, (void *) &ifr) < 0){ err = -errno; printk("TUNSETIFF failed, errno = %d\n", errno); - os_close_file(pri->fd); + close(pri->fd); return err; } } else { - err = os_pipe(fds, 0, 0); - if(err < 0){ - printk("tuntap_open : os_pipe failed - err = %d\n", - -err); + err = socketpair(AF_UNIX, SOCK_DGRAM, 0, fds); + if(err){ + err = -errno; + printk("tuntap_open : socketpair failed - errno = %d\n", + errno); return err; } buffer = get_output_buffer(&len); - if(buffer != NULL) len--; + if(buffer != NULL) + len--; used = 0; err = tuntap_open_tramp(pri->gate_addr, &pri->fd, fds[0], @@ -186,7 +188,7 @@ static int tuntap_open(void *data) printk("%s", output); free_output_buffer(buffer); - os_close_file(fds[0]); + close(fds[0]); iter_addresses(pri->dev, open_addr, pri->dev_name); } @@ -199,7 +201,7 @@ static void tuntap_close(int fd, void *data) if(!pri->fixed_config) iter_addresses(pri->dev, close_addr, pri->dev_name); - os_close_file(fd); + close(fd); pri->fd = -1; } |