[Midnightbsd-cvs] src [8061] trunk/lib/libc/stdlib: ptsname may set errno per spec

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 15 17:39:22 EDT 2016


Revision: 8061
          http://svnweb.midnightbsd.org/src/?rev=8061
Author:   laffer1
Date:     2016-09-15 17:39:21 -0400 (Thu, 15 Sep 2016)
Log Message:
-----------
ptsname may set errno per spec

Modified Paths:
--------------
    trunk/lib/libc/stdlib/ptsname.3
    trunk/lib/libc/stdlib/ptsname.c

Modified: trunk/lib/libc/stdlib/ptsname.3
===================================================================
--- trunk/lib/libc/stdlib/ptsname.3	2016-09-15 21:35:49 UTC (rev 8060)
+++ trunk/lib/libc/stdlib/ptsname.3	2016-09-15 21:39:21 UTC (rev 8061)
@@ -102,7 +102,8 @@
 pointer is returned.
 .Sh ERRORS
 The
-.Fn grantpt
+.Fn grantpt ,
+.Fn ptsname
 and
 .Fn unlockpt
 functions may fail and set

Modified: trunk/lib/libc/stdlib/ptsname.c
===================================================================
--- trunk/lib/libc/stdlib/ptsname.c	2016-09-15 21:35:49 UTC (rev 8060)
+++ trunk/lib/libc/stdlib/ptsname.c	2016-09-15 21:39:21 UTC (rev 8061)
@@ -77,7 +77,6 @@
 {
 	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 @@
 	    sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL)
 		ret = pt_slave;
 
-done:	/* Make sure ptsname() does not overwrite errno. */
-	errno = sverrno;
+done:
 	return (ret);
 }



More information about the Midnightbsd-cvs mailing list