mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Fix errno handling in posix_openpt.
The implementation of posix_openpt on Linux can fail in a few extra ways if the appropriate pseudo filesystems are not mounted etc. In some of these cases we have to explicitly set errno.
This commit is contained in:
committed by
Ulrich Drepper
parent
22bc5239e1
commit
d79eccd6dd
@ -1,3 +1,8 @@
|
|||||||
|
2009-10-27 Andreas Schwab <schwab@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/getpt.c (__posix_openpt): Make sure
|
||||||
|
errno is always set when returning unsuccessfully.
|
||||||
|
|
||||||
2009-10-29 Andreas Schwab <schwab@redhat.com>
|
2009-10-29 Andreas Schwab <schwab@redhat.com>
|
||||||
|
|
||||||
* malloc/memusage.c (update_data): Fix index wraparound handling
|
* malloc/memusage.c (update_data): Fix index wraparound handling
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1998, 1999, 2001, 2009 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
|
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
|
||||||
|
|
||||||
@ -64,9 +64,10 @@ __posix_openpt (oflag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If /dev/pts is not mounted then the UNIX98 pseudo terminals
|
/* If /dev/pts is not mounted then the UNIX98 pseudo terminals
|
||||||
are not usable. */
|
are not usable. */
|
||||||
__close (fd);
|
__close (fd);
|
||||||
have_no_dev_ptmx = 1;
|
have_no_dev_ptmx = 1;
|
||||||
|
__set_errno (ENOENT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -76,6 +77,8 @@ __posix_openpt (oflag)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
__set_errno (ENOENT);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user