diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2007-03-07 20:41:14 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-08 07:38:21 -0800 |
commit | de7b37cd01f145dd3a3ca333fd631e58ec0bdbab (patch) | |
tree | 97df058239eb286a649660f110faaa8924f7c9db /arch/um | |
parent | 0f97869df672f7f05ce3e8672ca42792d6df852b (diff) | |
download | op-kernel-dev-de7b37cd01f145dd3a3ca333fd631e58ec0bdbab.zip op-kernel-dev-de7b37cd01f145dd3a3ca333fd631e58ec0bdbab.tar.gz |
[PATCH] um: fix errno usage
Avoid reusing userspace errno twice - it can be cleared by libc code
everywhere (in particular printk() does clear it in my setup).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/daemon_user.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c index 310af0f..021b82c 100644 --- a/arch/um/drivers/daemon_user.c +++ b/arch/um/drivers/daemon_user.c @@ -56,30 +56,31 @@ static int connect_to_switch(struct daemon_data *pri) pri->control = socket(AF_UNIX, SOCK_STREAM, 0); if(pri->control < 0){ + err = -errno; printk("daemon_open : control socket failed, errno = %d\n", - errno); - return(-errno); + -err); + return err; } if(connect(pri->control, (struct sockaddr *) ctl_addr, sizeof(*ctl_addr)) < 0){ - printk("daemon_open : control connect failed, errno = %d\n", - errno); err = -errno; + printk("daemon_open : control connect failed, errno = %d\n", + -err); goto out; } fd = socket(AF_UNIX, SOCK_DGRAM, 0); if(fd < 0){ - printk("daemon_open : data socket failed, errno = %d\n", - errno); err = -errno; + printk("daemon_open : data socket failed, errno = %d\n", + -err); goto out; } if(bind(fd, (struct sockaddr *) local_addr, sizeof(*local_addr)) < 0){ - printk("daemon_open : data bind failed, errno = %d\n", - errno); err = -errno; + printk("daemon_open : data bind failed, errno = %d\n", + -err); goto out_close; } |