From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 23:51:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 173831065692; Sun, 6 Dec 2009 23:51:28 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 065E28FC0A; Sun, 6 Dec 2009 23:51:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB6NpRNq035488; Sun, 6 Dec 2009 23:51:27 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6NpRhv035486; Sun, 6 Dec 2009 23:51:27 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912062351.nB6NpRhv035486@svn.freebsd.org> From: Sean Farley Date: Sun, 6 Dec 2009 23:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200195 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 23:51:28 -0000 Author: scf Date: Sun Dec 6 23:51:27 2009 New Revision: 200195 URL: http://svn.freebsd.org/changeset/base/200195 Log: Update the getenv(3) man page to reflect the recent change to the behavior of setenv(), putenv() and unsetenv() when dealing with corrupt entries in environ. They now output a warning and complete their task without error. MFC after: 1 week Modified: head/lib/libc/stdlib/getenv.3 Modified: head/lib/libc/stdlib/getenv.3 ============================================================================== --- head/lib/libc/stdlib/getenv.3 Sun Dec 6 23:48:38 2009 (r200194) +++ head/lib/libc/stdlib/getenv.3 Sun Dec 6 23:51:27 2009 (r200195) @@ -107,6 +107,15 @@ function deletes all instances of the variable name pointed to by .Fa name from the list. +.Pp +If corruption (e.g., a name without a value) is detected while making a copy of +environ for internal usage, then +.Fn setenv , +.Fn unsetenv +and +.Fn putenv +will output a warning to stderr about the issue, drop the corrupt entry and +complete the task without error. .Sh RETURN VALUES The .Fn getenv @@ -159,15 +168,6 @@ The function or .Fn putenv failed because they were unable to allocate memory for the environment. -.It Bq Er EFAULT -The functions -.Fn setenv , -.Fn unsetenv -or -.Fn putenv -failed to make a valid copy of the environment due to the environment being -corrupt (i.e., a name without a value). A warning will be output to stderr with -information about the issue. .El .Sh SEE ALSO .Xr csh 1 ,