diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2010-08-08 14:42:46 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2010-08-08 14:42:46 +0000 |
commit | 69923723b39aecea4e2cd3c8639b43f2af14e85d (patch) | |
tree | e4c022bda090429a454305eba5b32cf9e51240dd /libc/sysdeps/mach | |
parent | 48fcb1f856cf90918d365ae5b7c8734c50a45b23 (diff) | |
download | eglibc2-69923723b39aecea4e2cd3c8639b43f2af14e85d.tar.gz |
Merge changes between r10807 and r11185 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@11186 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/mach')
-rw-r--r-- | libc/sysdeps/mach/hurd/sendmsg.c | 12 | ||||
-rw-r--r-- | libc/sysdeps/mach/hurd/ttyname.c | 8 | ||||
-rw-r--r-- | libc/sysdeps/mach/hurd/ttyname_r.c | 6 |
3 files changed, 21 insertions, 5 deletions
diff --git a/libc/sysdeps/mach/hurd/sendmsg.c b/libc/sysdeps/mach/hurd/sendmsg.c index a9d1c8c1d..118fd59a5 100644 --- a/libc/sysdeps/mach/hurd/sendmsg.c +++ b/libc/sysdeps/mach/hurd/sendmsg.c @@ -109,14 +109,22 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags) and talk to it with the ifsock protocol. */ file_t file = __file_name_lookup (addr->sun_path, 0, 0); if (file == MACH_PORT_NULL) - return -1; + { + if (dealloc) + __vm_deallocate (__mach_task_self (), data.addr, len); + return -1; + } err = __ifsock_getsockaddr (file, &aport); __mach_port_deallocate (__mach_task_self (), file); if (err == MIG_BAD_ID || err == EOPNOTSUPP) /* The file did not grok the ifsock protocol. */ err = ENOTSOCK; if (err) - return __hurd_fail (err); + { + if (dealloc) + __vm_deallocate (__mach_task_self (), data.addr, len); + return __hurd_fail (err); + } } else err = EIEIO; diff --git a/libc/sysdeps/mach/hurd/ttyname.c b/libc/sysdeps/mach/hurd/ttyname.c index 927851e2e..6e2e5bf67 100644 --- a/libc/sysdeps/mach/hurd/ttyname.c +++ b/libc/sysdeps/mach/hurd/ttyname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1997, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,7 +32,11 @@ ttyname (int fd) nodename[0] = '\0'; if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename))) - return __hurd_dfail (fd, err), NULL; + { + if (err == MIG_BAD_ID || err == EOPNOTSUPP) + err = ENOTTY; + return __hurd_dfail (fd, err), NULL; + } return nodename; } diff --git a/libc/sysdeps/mach/hurd/ttyname_r.c b/libc/sysdeps/mach/hurd/ttyname_r.c index 889625224..5f6c9c35f 100644 --- a/libc/sysdeps/mach/hurd/ttyname_r.c +++ b/libc/sysdeps/mach/hurd/ttyname_r.c @@ -34,7 +34,11 @@ __ttyname_r (int fd, char *buf, size_t buflen) nodename[0] = '\0'; if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename))) - return __hurd_dfail (fd, err), errno; + { + if (err == MIG_BAD_ID || err == EOPNOTSUPP) + err = ENOTTY; + return __hurd_dfail (fd, err), errno; + } len = strlen (nodename) + 1; if (len > buflen) |