Pass name to afp_config_parse and use NULL for processname as test
authorFrank Lahm <franklahm@googlemail.com>
Mon, 16 Apr 2012 08:32:29 +0000 (10:32 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 16 Apr 2012 08:32:29 +0000 (10:32 +0200)
bin/ad/ad.c
etc/cnid_dbd/cmd_dbd.c
libatalk/util/netatalk_conf.c
test/afpd/test.c

index 083bb62ae3905f0562706ea06dc986e92b5e6902..7f5b3da6260e626ae210dfa71c82e13777a55240 100644 (file)
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    if (afp_config_parse(&obj, "") != 0)
+    if (afp_config_parse(&obj, "ad") != 0)
         return 1;
 
     setuplog("default:note", "/dev/tty");
index 70f0014ebddc1d94eb1bd49fe83977ca098cf984..91a3ac3504695fddf839ad03869cb2d1bfd3d6ab 100644 (file)
@@ -258,7 +258,7 @@ int main(int argc, char **argv)
         setuplog("default:debug", "/dev/tty");
 
     /* Load config */
-    if (afp_config_parse(&obj, "") != 0) {
+    if (afp_config_parse(&obj, "dbd") != 0) {
         dbd_log( LOGSTD, "Couldn't load afp.conf");
         exit(EXIT_FAILURE);
     }
index 26c80f112e4812b86b51ec953d21492c533bab7b..a3cd87e7a551b77919ade214054720473eb56df4 100644 (file)
@@ -1404,6 +1404,9 @@ int afp_config_parse(AFPObj *AFPObj, char *processname)
     char *q, *r;
     char val[MAXVAL];
 
+    if (processname != NULL)
+        set_processname(processname);
+
     AFPObj->afp_version = 11;
     options->configfile  = AFPObj->cmdlineconfigfile ? strdup(AFPObj->cmdlineconfigfile) : strdup(_PATH_CONFDIR "afp.conf");
     options->sigconffile = strdup(_PATH_STATEDIR "afp_signature.conf");
@@ -1418,10 +1421,7 @@ int afp_config_parse(AFPObj *AFPObj, char *processname)
     options->logconfig = iniparser_getstrdup(config, INISEC_GLOBAL, "log level", "default:note");
     options->logfile   = iniparser_getstrdup(config, INISEC_GLOBAL, "log file",  NULL);
 
-    if (processname[0] != '\0') {
-        set_processname(processname);
-        setuplog(options->logconfig, options->logfile);
-    }
+    setuplog(options->logconfig, options->logfile);
 
     /* "server options" boolean options */
     if (!iniparser_getboolean(config, INISEC_GLOBAL, "zeroconf", 1))
index acc46a8765b37227ec630e0efa35c49841970314..54fc23745a70a8bf519428a8e2f4f174137acf13 100644 (file)
@@ -64,7 +64,7 @@ int main(int argc, char **argv)
 
     TEST( afp_options_parse_cmdline(&obj, 3, &args[0]) );
 
-    TEST_int( afp_config_parse(&obj, ""), 0);
+    TEST_int( afp_config_parse(&obj, NULL), 0);
     TEST_int( configinit(&obj), 0);
     TEST( cnid_init() );
     TEST( load_volumes(&obj, NULL) );