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"); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"