summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-10-24 20:23:10 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-10-24 20:23:10 +0000
commit8e830616fa05298d2e2fe7815932db59b1404209 (patch)
treef5a8a78a0ede264def0c39ac6d8918ae9283fd19
parent5da0efd695990a96376d30986ce3dde7d0c42f04 (diff)
Add the 5 needed lines to support -D makro=value option. Another surprising
finding by lint.
-rw-r--r--usr.sbin/ripd/ripd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/ripd/ripd.c b/usr.sbin/ripd/ripd.c
index 6acca39ce2b..5c91167ce68 100644
--- a/usr.sbin/ripd/ripd.c
+++ b/usr.sbin/ripd/ripd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripd.c,v 1.7 2007/10/24 19:05:06 claudio Exp $ */
+/* $OpenBSD: ripd.c,v 1.8 2007/10/24 20:23:09 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -72,7 +72,8 @@ usage(void)
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-dnv] [-f file]\n", __progname);
+ fprintf(stderr, "usage: %s [-dnv] [-D macro=value] [-f file]\n",
+ __progname);
exit(1);
}
@@ -130,11 +131,16 @@ main(int argc, char *argv[])
log_init(1); /* log to stderr until daemonized */
- while ((ch = getopt(argc, argv, "df:nv")) != -1) {
+ while ((ch = getopt(argc, argv, "dD:f:nv")) != -1) {
switch (ch) {
case 'd':
debug = 1;
break;
+ case 'D':
+ if (cmdline_symset(optarg) < 0)
+ log_warnx("could not parse macro definition %s",
+ optarg);
+ break;
case 'f':
conffile = optarg;
break;