From owner-svn-src-head@FreeBSD.ORG Mon Dec 28 02:09:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61951106568D; Mon, 28 Dec 2009 02:09:57 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 517C28FC13; Mon, 28 Dec 2009 02:09:57 +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 nBS29vvi075154; Mon, 28 Dec 2009 02:09:57 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBS29viN075152; Mon, 28 Dec 2009 02:09:57 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912280209.nBS29viN075152@svn.freebsd.org> From: Tim Kientzle Date: Mon, 28 Dec 2009 02:09:57 +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: r201083 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 02:09:57 -0000 Author: kientzle Date: Mon Dec 28 02:09:57 2009 New Revision: 201083 URL: http://svn.freebsd.org/changeset/base/201083 Log: Compatibility fix for some older systems with non-POSIX getgrnam_r/getpwnam_r and a minor style fix for the hash function. Modified: head/lib/libarchive/archive_write_disk_set_standard_lookup.c Modified: head/lib/libarchive/archive_write_disk_set_standard_lookup.c ============================================================================== --- head/lib/libarchive/archive_write_disk_set_standard_lookup.c Mon Dec 28 02:05:28 2009 (r201082) +++ head/lib/libarchive/archive_write_disk_set_standard_lookup.c Mon Dec 28 02:09:57 2009 (r201083) @@ -125,6 +125,7 @@ lookup_gid(void *private_data, const cha int r; for (;;) { + result = &grent; /* Old getgrnam_r ignores last arg. */ r = getgrnam_r(gname, &grent, buffer, bufsize, &result); if (r == 0) break; @@ -184,6 +185,7 @@ lookup_uid(void *private_data, const cha int r; for (;;) { + result = &pwent; /* Old getpwnam_r ignores last arg. */ r = getpwnam_r(uname, &pwent, buffer, bufsize, &result); if (r == 0) break; @@ -230,8 +232,8 @@ hash(const char *p) as used by ELF for hashing function names. */ unsigned g, h = 0; while (*p != '\0') { - h = ( h << 4 ) + *p++; - if (( g = h & 0xF0000000 )) { + h = (h << 4) + *p++; + if ((g = h & 0xF0000000) != 0) { h ^= g >> 24; h &= 0x0FFFFFFF; }