version 1.254, 2015/11/06 16:30:33 |
version 1.256, 2015/11/07 14:22:29 |
|
|
|
|
#include <assert.h> |
#include <assert.h> |
#include <ctype.h> |
#include <ctype.h> |
|
#if HAVE_ERR |
#include <err.h> |
#include <err.h> |
|
#endif |
#include <fcntl.h> |
#include <fcntl.h> |
#include <glob.h> |
#include <glob.h> |
#include <signal.h> |
#include <signal.h> |
Line 149 main(int argc, char *argv[]) |
|
Line 151 main(int argc, char *argv[]) |
|
return mandocdb(argc, argv); |
return mandocdb(argc, argv); |
#endif |
#endif |
|
|
|
#if HAVE_PLEDGE |
|
if (pledge("stdio rpath tmppath proc exec flock", NULL) == -1) |
|
err((int)MANDOCLEVEL_SYSERR, "pledge"); |
|
#endif |
|
|
/* Search options. */ |
/* Search options. */ |
|
|
memset(&conf, 0, sizeof(conf)); |
memset(&conf, 0, sizeof(conf)); |
Line 288 main(int argc, char *argv[]) |
|
Line 295 main(int argc, char *argv[]) |
|
!isatty(STDOUT_FILENO)) |
!isatty(STDOUT_FILENO)) |
use_pager = 0; |
use_pager = 0; |
|
|
|
#if HAVE_PLEDGE |
|
if (!use_pager && pledge("stdio rpath flock", NULL) == -1) |
|
err((int)MANDOCLEVEL_SYSERR, "pledge"); |
|
#endif |
|
|
/* Parse arguments. */ |
/* Parse arguments. */ |
|
|
if (argc > 0) { |
if (argc > 0) { |
Line 414 main(int argc, char *argv[]) |
|
Line 426 main(int argc, char *argv[]) |
|
|
|
/* mandoc(1) */ |
/* mandoc(1) */ |
|
|
|
#if HAVE_PLEDGE |
|
if (pledge(use_pager ? "stdio rpath tmppath proc exec" : |
|
"stdio rpath", NULL) == -1) |
|
err((int)MANDOCLEVEL_SYSERR, "pledge"); |
|
#endif |
|
|
if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths)) |
if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths)) |
return (int)MANDOCLEVEL_BADARG; |
return (int)MANDOCLEVEL_BADARG; |
|
|
Line 1004 spawn_pager(struct tag_files *tag_files) |
|
Line 1022 spawn_pager(struct tag_files *tag_files) |
|
case 0: |
case 0: |
break; |
break; |
default: |
default: |
|
#if HAVE_PLEDGE |
|
if (pledge("stdio rpath tmppath", NULL) == -1) |
|
err((int)MANDOCLEVEL_SYSERR, "pledge"); |
|
#endif |
return pager_pid; |
return pager_pid; |
} |
} |
|
|