Support for the old '-L' option.
(Incredibly clunky, but necessary)
git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@8556 06827809-a52a-0410-b366-d66718629ded
diff --git a/agent/snmpd.c b/agent/snmpd.c
index c36a46c..23be44a 100644
--- a/agent/snmpd.c
+++ b/agent/snmpd.c
@@ -436,6 +436,7 @@
char logfile[PATH_MAX + 1] = { 0 };
char *cptr, **argvptr;
char *pid_file = NULL;
+ char *option_compatability = "-Le";
#if HAVE_GETPID
int fd;
FILE *PID;
@@ -476,9 +477,17 @@
#endif
/*
+ * This is incredibly ugly, but it's probably the simplest way
+ * to handle the old '-L' option as well as the new '-Lx' style
+ */
+ for (i=0; i<argc; i++) {
+ if (!strcmp(argv[i], "-L"))
+ argv[i] = option_compatability;
+ }
+
+ /*
* Now process options normally.
*/
-
while ((arg = getopt(argc, argv, options)) != EOF) {
switch (arg) {
case '-':