diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2018-07-10 13:02:15 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2018-07-10 13:02:15 +0000 |
commit | eebdb39e841abef771207afc65d576874d614060 (patch) | |
tree | a0f72a5ef60e18b69434d2740f9dddd1dbe8301a /usr.sbin/bgpctl/bgpctl.c | |
parent | 502dbaed6d16781454fe316f44ab93cf70eb71ae (diff) |
move the top level pledge, getrtable() works with pledge stdio.
ok claudio@ phessler@
Diffstat (limited to 'usr.sbin/bgpctl/bgpctl.c')
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index bec68d17eb6..2b36c46b5e5 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.202 2017/11/27 16:53:04 sthen Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.203 2018/07/10 13:02:14 benno Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -129,13 +129,13 @@ main(int argc, char *argv[]) char *sockname; enum imsg_type type; + if (pledge("stdio rpath wpath cpath unix inet dns", NULL) == -1) + err(1, "pledge"); + r = getrtable(); if (asprintf(&sockname, "%s.%d", SOCKET_NAME, r) == -1) err(1, "asprintf"); - if (pledge("stdio rpath wpath cpath unix inet dns", NULL) == -1) - err(1, "pledge"); - while ((ch = getopt(argc, argv, "ns:")) != -1) { switch (ch) { case 'n': |