[PATCH] Fix errno handling in posix_openpt
Andreas Schwab
schwab@redhat.com
Tue Oct 27 13:40:00 GMT 2009
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.
diff --git a/sysdeps/unix/sysv/linux/getpt.c b/sysdeps/unix/sysv/linux/getpt.c
index bb1ea47..f3a1f81 100644
--- a/sysdeps/unix/sysv/linux/getpt.c
+++ b/sysdeps/unix/sysv/linux/getpt.c
@@ -67,6 +67,7 @@ __posix_openpt (oflag)
are not usable. */
__close (fd);
have_no_dev_ptmx = 1;
+ __set_errno (ENOENT);
}
else
{
@@ -76,6 +77,8 @@ __posix_openpt (oflag)
return -1;
}
}
+ else
+ __set_errno (ENOENT);
return -1;
}
--
1.6.5.1
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
More information about the Libc-alpha
mailing list