chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / debian / patches / hurd-i386 / cvs-ttyname.diff
1 http://www.cygwin.com/ml/libc-alpha/2010-06/msg00005.html
2
3 2010-06-06  Samuel Thibault  <samuel.thibault@ens-lyon.org>
4
5         * sysdeps/mach/hurd/ttyname.c (ttyname): Replace MIG_BAD_ID and
6         EOPNOTSUPP errors with ENOTTY.
7         * sysdeps/mach/hurd/ttyname_r.c (__ttyname_r): Replace MIG_BAD_ID and
8         EOPNOTSUPP errors with ENOTTY.
9
10 ---
11  ttyname.c   |    8 ++++++--
12  ttyname_r.c |    8 ++++++--
13  2 files changed, 12 insertions(+), 4 deletions(-)
14
15 diff --git a/sysdeps/mach/hurd/ttyname.c b/sysdeps/mach/hurd/ttyname.c
16 index 927851e..6e2e5bf 100644
17 --- a/sysdeps/mach/hurd/ttyname.c
18 +++ b/sysdeps/mach/hurd/ttyname.c
19 @@ -1,4 +1,4 @@
20 -/* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
21 +/* Copyright (C) 1994, 1997, 2010 Free Software Foundation, Inc.
22     This file is part of the GNU C Library.
23  
24     The GNU C Library is free software; you can redistribute it and/or
25 @@ -32,7 +32,11 @@ ttyname (int fd)
26  
27    nodename[0] = '\0';
28    if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename)))
29 -    return __hurd_dfail (fd, err), NULL;
30 +    {
31 +      if (err == MIG_BAD_ID || err == EOPNOTSUPP)
32 +       err = ENOTTY;
33 +      return __hurd_dfail (fd, err), NULL;
34 +    }
35  
36    return nodename;
37  }
38 diff --git a/sysdeps/mach/hurd/ttyname_r.c b/sysdeps/mach/hurd/ttyname_r.c
39 index 8896252..5f6c9c3 100644
40 --- a/sysdeps/mach/hurd/ttyname_r.c
41 +++ b/sysdeps/mach/hurd/ttyname_r.c
42 @@ -34,7 +34,11 @@ __ttyname_r (int fd, char *buf, size_t buflen)
43  
44    nodename[0] = '\0';
45    if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename)))
46 -    return __hurd_dfail (fd, err), errno;
47 +    {
48 +      if (err == MIG_BAD_ID || err == EOPNOTSUPP)
49 +       err = ENOTTY;
50 +      return __hurd_dfail (fd, err), errno;
51 +    }
52  
53    len = strlen (nodename) + 1;
54    if (len > buflen)