]> arthur.barton.de Git - netatalk.git/commitdiff
-setuplog can now be called multiple times.
authorfranklahm <franklahm>
Wed, 1 Apr 2009 12:40:41 +0000 (12:40 +0000)
committerfranklahm <franklahm>
Wed, 1 Apr 2009 12:40:41 +0000 (12:40 +0000)
Example:
server \
    -setuplog "cnid log_maxdebug /var/log/cnid.log" \
    -setuplog "default log_info /var/log/afpd.log"

etc/afpd/afp_options.c

index 6d413c8bba9e16447f551977b9935c59027175ef..0785df30c109e1ead8ed90dd2b32b6694fc17268 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_options.c,v 1.41 2009-03-31 11:40:26 franklahm Exp $
+ * $Id: afp_options.c,v 1.42 2009-04-01 12:40:41 franklahm Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -319,8 +319,15 @@ int afp_options_parseline(char *buf, struct afp_options *options)
     }
 
     /* -[no]setuplog <logtype> <loglevel> [<filename>]*/
-    if ((c = getoption(buf, "-setuplog")))
-      setuplog(c);
+    char *optstr;
+    c = buf;
+    /* Now THIS is hokey! Multiple occurrences are not supported by our current code, */
+    /* so I have to loop myself. */
+    while (NULL != (c = strstr(c, "-setuplog")))
+        if ((optstr = getoption(c, "-setuplog"))) {
+            setuplog(optstr);
+            c += sizeof("-setuplog");
+        }
 
     if ((c = getoption(buf, "-unsetuplog")))
       unsetuplog(c);