From owner-svn-src-head@freebsd.org Wed Jun 20 00:13:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C2C1017EC3; Wed, 20 Jun 2018 00:13:11 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C52BB7CCB3; Wed, 20 Jun 2018 00:13:10 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5A6A1AD76; Wed, 20 Jun 2018 00:13:10 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K0DA3f023072; Wed, 20 Jun 2018 00:13:10 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K0DA1v023070; Wed, 20 Jun 2018 00:13:10 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806200013.w5K0DA1v023070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 20 Jun 2018 00:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335397 - in head/usr.bin: primes uniq X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head/usr.bin: primes uniq X-SVN-Commit-Revision: 335397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 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: Wed, 20 Jun 2018 00:13:11 -0000 Author: oshogbo Date: Wed Jun 20 00:13:09 2018 New Revision: 335397 URL: https://svnweb.freebsd.org/changeset/base/335397 Log: Use capsicum helpers to cache NLS data. Modified: head/usr.bin/primes/primes.c head/usr.bin/uniq/uniq.c Modified: head/usr.bin/primes/primes.c ============================================================================== --- head/usr.bin/primes/primes.c Tue Jun 19 23:57:12 2018 (r335396) +++ head/usr.bin/primes/primes.c Wed Jun 20 00:13:09 2018 (r335397) @@ -101,9 +101,7 @@ main(int argc, char *argv[]) int ch; char *p; - /* Cache NLS data, for strerror, for err(3), before cap_enter. */ - (void)catopen("libc", NL_CAT_LOCALE); - + caph_cache_catpages(); if (caph_enter() < 0) err(1, "cap_enter"); Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Tue Jun 19 23:57:12 2018 (r335396) +++ head/usr.bin/uniq/uniq.c Wed Jun 20 00:13:09 2018 (r335397) @@ -87,17 +87,6 @@ static wchar_t *skip(wchar_t *); static void obsolete(char *[]); static void usage(void); -static void -strerror_init(void) -{ - - /* - * Cache NLS data before entering capability mode. - * XXXPJD: There should be strerror_init() and strsignal_init() in libc. - */ - (void)catopen("libc", NL_CAT_LOCALE); -} - int main (int argc, char *argv[]) { @@ -177,7 +166,7 @@ main (int argc, char *argv[]) } } - strerror_init(); + caph_cache_catpages(); if (caph_enter() < 0) err(1, "unable to enter capability mode");