links2

links 2.15+ fork
git clone git://git.codemadness.org/links2
Log | Files | Refs | README

commit e6c4ff3784bc1cf21d528ec770a1d07290824c16
parent 9cea22fd73b93ba80b27bb0886c526f4fff230eb
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri,  4 May 2018 11:51:25 +0200

initial pledge for links

Diffstat:
main.c | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c @@ -6,6 +6,12 @@ #include "links.h" +#ifdef USE_PLEDGE +#include <unistd.h> +#else +#define pledge(a,b) 0 +#endif + int retval = RET_OK; static void unhandle_basic_signals(struct terminal *); @@ -561,11 +567,17 @@ static void terminate_all_subsystems(void) terminate_osdep(); } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { g_argc = argc; g_argv = (unsigned char **)argv; + if (pledge("stdio rpath cpath wpath dns inet tty proc", NULL) < 0) { + fprintf(stderr, "pledge: %s\n", strerror(errno)); + return 1; + } + #if 0 if (argc != 3) fprintf(stderr, "two args expected\n"), exit(1);