etc: Add environment option to run init.d/ashd silently.
[ashd.git] / src / htparser.c
index 348a940..5491855 100644 (file)
@@ -580,9 +580,12 @@ static void addport(char *spec)
     /* XXX: It would be nice to decentralize this, but, meh... */
     if(!strcmp(nm, "plain")) {
        handleplain(pars.d, pars.b, vals.b);
-#ifdef HAVE_GNUTLS
+#if defined HAVE_GNUTLS
     } else if(!strcmp(nm, "ssl")) {
        handlegnussl(pars.d, pars.b, vals.b);
+#elif defined HAVE_OPENSSL
+    } else if(!strcmp(nm, "ssl")) {
+       handleossl(pars.d, pars.b, vals.b);
 #endif
     } else {
        flog(LOG_ERR, "htparser: unknown port handler `%s'", nm);
@@ -607,7 +610,7 @@ int main(int argc, char **argv)
     struct passwd *pwent;
     
     daemonize = usesyslog = 0;
-    root = NULL;
+    root = pidfile = NULL;
     pwent = NULL;
     while((c = getopt(argc, argv, "+hSfu:r:p:")) >= 0) {
        switch(c) {
@@ -621,16 +624,16 @@ int main(int argc, char **argv)
            usesyslog = 1;
            break;
        case 'u':
-           if((pwent = getpwnam(optarg)) == NULL) {
+           if(optarg[0] && ((pwent = getpwnam(optarg)) == NULL)) {
                flog(LOG_ERR, "could not find user %s", optarg);
                exit(1);
            }
            break;
        case 'r':
-           root = optarg;
+           root = optarg[0] ? optarg : NULL;
            break;
        case 'p':
-           pidfile = optarg;
+           pidfile = optarg[0] ? optarg : NULL;
            break;
        default:
            usage(stderr);