diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-02-07 13:30:18 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-02-07 13:30:18 +0000 |
commit | d2e1fab1c1884d2b52a8d0ce7a62ca22b0612229 (patch) | |
tree | 717ea3c170726b6cc3cd52b5ce9d8c765a18e562 /usr.sbin/hoststated/hoststated.c | |
parent | 0dd18a7d99ace8598386e9c2f2640b28fec15f9c (diff) |
add the -D option to define macros on the command line (as found in
bgpd(8), hostapd(8), ipsecctl(8), pfctl(8), ...).
Diffstat (limited to 'usr.sbin/hoststated/hoststated.c')
-rw-r--r-- | usr.sbin/hoststated/hoststated.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/hoststated/hoststated.c b/usr.sbin/hoststated/hoststated.c index 0648bb3b31b..32aba7bfc10 100644 --- a/usr.sbin/hoststated/hoststated.c +++ b/usr.sbin/hoststated/hoststated.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hoststated.c,v 1.14 2007/02/06 10:03:08 reyk Exp $ */ +/* $OpenBSD: hoststated.c,v 1.15 2007/02/07 13:30:17 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -112,11 +112,16 @@ main(int argc, char *argv[]) conffile = CONF_FILE; bzero(&env, sizeof (env)); - for (;(c = getopt(argc, argv, "dnf:v")) != -1;) { + for (;(c = getopt(argc, argv, "dD:nf:v")) != -1;) { switch (c) { case 'd': debug = 1; break; + case 'D': + if (cmdline_symset(optarg) < 0) + log_warnx("could not parse macro definition %s", + optarg); + break; case 'n': opts |= HOSTSTATED_OPT_NOACTION; break; |