diff options
author | Ricardo Mestre <mestre@cvs.openbsd.org> | 2019-07-11 17:28:33 +0000 |
---|---|---|
committer | Ricardo Mestre <mestre@cvs.openbsd.org> | 2019-07-11 17:28:33 +0000 |
commit | e8480c18d3ee5488c9486d18b699b9eb2d669774 (patch) | |
tree | edfc5ccbf8fa3b951013ca11598ccd793f67230f /usr.bin/tsort | |
parent | 309da6814f91669953c90b567e685d90e2e6dfef (diff) |
Remove duplicate pledge(2) and comment from another era. While here also place
the final pledge "stdio" within main() for better readability.
OK espie@
Diffstat (limited to 'usr.bin/tsort')
-rw-r--r-- | usr.bin/tsort/tsort.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c index 5caa733f430..3e0e1abf73c 100644 --- a/usr.bin/tsort/tsort.c +++ b/usr.bin/tsort/tsort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tsort.c,v 1.36 2017/05/20 09:31:19 espie Exp $ */ +/* $OpenBSD: tsort.c,v 1.37 2019/07/11 17:28:32 mestre Exp $ */ /* ex:ts=8 sw=4: * * Copyright (c) 1999-2004 Marc Espie <espie@openbsd.org> @@ -879,10 +879,6 @@ parse_args(int argc, char *argv[], struct ohash *pairs) files[i] = NULL; -/* if (pledge("stdio rpath", files) == -1) */ - if (pledge("stdio rpath", NULL) == -1) - err(1, "pledge"); - nodes_init(pairs); order = 0; @@ -910,9 +906,6 @@ parse_args(int argc, char *argv[], struct ohash *pairs) order = read_pairs(stdin, pairs, reverse_flag, "stdin", order, hints_flag == 2); } - - if (pledge("stdio", NULL) == -1) - err(1, "pledge"); } static int @@ -1003,6 +996,10 @@ main(int argc, char *argv[]) err(1, "pledge"); parse_args(argc, argv, &pairs); + + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + return tsort(&pairs); } |