From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 15:40:59 2010 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 7BCB5106566C; Tue, 5 Oct 2010 15:40:59 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B0F68FC0A; Tue, 5 Oct 2010 15:40:59 +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 o95FexAo061281; Tue, 5 Oct 2010 15:40:59 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95Fexpb061277; Tue, 5 Oct 2010 15:40:59 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201010051540.o95Fexpb061277@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 5 Oct 2010 15:40:59 +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: r213453 - head/lib/libc/net 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: Tue, 05 Oct 2010 15:40:59 -0000 Author: ume Date: Tue Oct 5 15:40:59 2010 New Revision: 213453 URL: http://svn.freebsd.org/changeset/base/213453 Log: When no protocol entry is found, getproto*_r(3) should return zero. Spotted by: Kostik Belousov MFC after: 2 weeks Modified: head/lib/libc/net/getproto.c head/lib/libc/net/getprotoent.c head/lib/libc/net/getprotoname.c Modified: head/lib/libc/net/getproto.c ============================================================================== --- head/lib/libc/net/getproto.c Tue Oct 5 15:31:56 2010 (r213452) +++ head/lib/libc/net/getproto.c Tue Oct 5 15:40:59 2010 (r213453) @@ -123,7 +123,7 @@ getprotobynumber_r(int proto, struct pro if (rv != NS_SUCCESS) { errno = ret_errno; - return ((ret_errno != 0) ? ret_errno : -1); + return (ret_errno); } return (0); } Modified: head/lib/libc/net/getprotoent.c ============================================================================== --- head/lib/libc/net/getprotoent.c Tue Oct 5 15:31:56 2010 (r213452) +++ head/lib/libc/net/getprotoent.c Tue Oct 5 15:40:59 2010 (r213453) @@ -494,7 +494,7 @@ getprotoent_r(struct protoent *pptr, cha if (rv != NS_SUCCESS) { errno = ret_errno; - return ((ret_errno != 0) ? ret_errno : -1); + return (ret_errno); } return (0); } Modified: head/lib/libc/net/getprotoname.c ============================================================================== --- head/lib/libc/net/getprotoname.c Tue Oct 5 15:31:56 2010 (r213452) +++ head/lib/libc/net/getprotoname.c Tue Oct 5 15:40:59 2010 (r213453) @@ -131,7 +131,7 @@ getprotobyname_r(const char *name, struc if (rv != NS_SUCCESS) { errno = ret_errno; - return ((ret_errno != 0) ? ret_errno : -1); + return (ret_errno); } return (0); }