Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/lam/lam.c
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
main(int argc, char *argv[]) | main(int argc, char *argv[]) | ||||
{ | { | ||||
struct openfile *ip; | struct openfile *ip; | ||||
if (argc == 1) | if (argc == 1) | ||||
usage(); | usage(); | ||||
if (caph_limit_stdio() == -1) | |||||
err(1, "unable to limit stdio"); | |||||
getargs(argv); | getargs(argv); | ||||
if (!morefiles) | if (!morefiles) | ||||
usage(); | usage(); | ||||
/* | /* | ||||
* Cache NLS data, for strerror, for err(3), before entering capability | * Cache NLS data, for strerror, for err(3), before entering capability | ||||
* mode. | * mode. | ||||
*/ | */ | ||||
caph_cache_catpages(); | caph_cache_catpages(); | ||||
caph_limit_stdio(); | |||||
if (cap_enter() < 0 && errno != ENOSYS) | if (cap_enter() < 0 && errno != ENOSYS) | ||||
err(1, "unable to enter capability mode"); | err(1, "unable to enter capability mode"); | ||||
for (;;) { | for (;;) { | ||||
linep = line; | linep = line; | ||||
for (ip = input; ip->fp != NULL; ip++) | for (ip = input; ip->fp != NULL; ip++) | ||||
linep = gatherline(ip); | linep = gatherline(ip); | ||||
if (!morefiles) | if (!morefiles) | ||||
▲ Show 20 Lines • Show All 139 Lines • Show Last 20 Lines |