summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/ptsname.c
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2012-09-12 17:54:09 +0000
committeremaste <emaste@FreeBSD.org>2012-09-12 17:54:09 +0000
commited3f0cd13dfb75dc788c906aa7ff44ade3f88e0e (patch)
tree386a529a3fff37d9694452ff5de2f15c0569a4ed /lib/libc/stdlib/ptsname.c
parent87d02085acfe4d673982fe13086761818cc076a4 (diff)
downloadFreeBSD-src-ed3f0cd13dfb75dc788c906aa7ff44ade3f88e0e.zip
FreeBSD-src-ed3f0cd13dfb75dc788c906aa7ff44ade3f88e0e.tar.gz
According to a clarification at http://austingroupbugs.net/view.php?id=503
ptsname may set errno, so avoid saving and restoring errno across the function. PR: standards/171572
Diffstat (limited to 'lib/libc/stdlib/ptsname.c')
-rw-r--r--lib/libc/stdlib/ptsname.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libc/stdlib/ptsname.c b/lib/libc/stdlib/ptsname.c
index 40b140d..3e4d4c0 100644
--- a/lib/libc/stdlib/ptsname.c
+++ b/lib/libc/stdlib/ptsname.c
@@ -77,7 +77,6 @@ ptsname(int fildes)
{
static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV;
char *ret = NULL;
- int sverrno = errno;
/* Make sure fildes points to a master device. */
if (__isptmaster(fildes) != 0)
@@ -87,7 +86,6 @@ ptsname(int fildes)
sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL)
ret = pt_slave;
-done: /* Make sure ptsname() does not overwrite errno. */
- errno = sverrno;
+done:
return (ret);
}
OpenPOWER on IntegriCloud