2001-12-10 Thorsten Kukuk * sysdeps/unix/sysv/linux/grantpt.c: Change ENOTTY errors of pts_name to EINVAL. * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): Don't overwrite errno value of isatty call (correct one is needed by grantpt). --- sysdeps/unix/sysv/linux/grantpt.c +++ sysdeps/unix/sysv/linux/grantpt.c 2001/12/10 09:31:15 @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2001 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 @@ -16,6 +16,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include #include @@ -46,7 +47,11 @@ char *buf = _buf; if (pts_name (fd, &buf, sizeof (_buf))) - return -1; + { + if (errno == ENOTTY) + __set_errno (EINVAL); + return -1; + } if (__statfs (buf, &fsbuf) < 0) return -1; --- sysdeps/unix/sysv/linux/ptsname.c +++ sysdeps/unix/sysv/linux/ptsname.c 2001/12/10 09:31:15 @@ -85,8 +85,7 @@ if (!__isatty (fd)) { - __set_errno (ENOTTY); - return ENOTTY; + return errno; } #ifdef TIOCGPTN