From owner-svn-src-stable-9@FreeBSD.ORG Sat Sep 15 02:58:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2D581065673; Sat, 15 Sep 2012 02:58:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD8468FC1D; Sat, 15 Sep 2012 02:58:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8F2w2dv064595; Sat, 15 Sep 2012 02:58:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8F2w2VT064592; Sat, 15 Sep 2012 02:58:02 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201209150258.q8F2w2VT064592@svn.freebsd.org> From: Ed Maste Date: Sat, 15 Sep 2012 02:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240529 - stable/9/lib/libc/stdlib X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 02:58:03 -0000 Author: emaste Date: Sat Sep 15 02:58:02 2012 New Revision: 240529 URL: http://svn.freebsd.org/changeset/base/240529 Log: MFC r240412: 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 Modified: stable/9/lib/libc/stdlib/ptsname.3 stable/9/lib/libc/stdlib/ptsname.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/ptsname.3 ============================================================================== --- stable/9/lib/libc/stdlib/ptsname.3 Sat Sep 15 02:52:19 2012 (r240528) +++ stable/9/lib/libc/stdlib/ptsname.3 Sat Sep 15 02:58:02 2012 (r240529) @@ -102,7 +102,8 @@ of the slave device on success; otherwis pointer is returned. .Sh ERRORS The -.Fn grantpt +.Fn grantpt , +.Fn ptsname and .Fn unlockpt functions may fail and set Modified: stable/9/lib/libc/stdlib/ptsname.c ============================================================================== --- stable/9/lib/libc/stdlib/ptsname.c Sat Sep 15 02:52:19 2012 (r240528) +++ stable/9/lib/libc/stdlib/ptsname.c Sat Sep 15 02:58:02 2012 (r240529) @@ -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); }