move all info() lines from parse_parameters() to startup_message(). Move DAEMON = 1 to getopt
This commit is contained in:
10
fiche.c
10
fiche.c
@@ -381,6 +381,9 @@ void startup_message()
|
|||||||
info("Domain name: %s\n", DOMAIN);
|
info("Domain name: %s\n", DOMAIN);
|
||||||
info("Saving files to: %s\n", BASEDIR);
|
info("Saving files to: %s\n", BASEDIR);
|
||||||
info("Fiche started listening on port %d.\n", PORT);
|
info("Fiche started listening on port %d.\n", PORT);
|
||||||
|
info("Buffer size set to: %d.\n", BUFSIZE);
|
||||||
|
info("Slug size set to: %d.\n", SLUG_SIZE);
|
||||||
|
info("Log file: %s\n", LOG);
|
||||||
info("====================================\n");
|
info("====================================\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,13 +399,11 @@ void parse_parameters(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
if (strcmp(*argv, "-D"))
|
|
||||||
DAEMON = 1;
|
|
||||||
|
|
||||||
while ((c = getopt (argc, argv, "Dep:b:s:d:o:l:B:u:w:")) != -1)
|
while ((c = getopt (argc, argv, "Dep:b:s:d:o:l:B:u:w:")) != -1)
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case 'D':
|
case 'D':
|
||||||
|
DAEMON = 1;
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
snprintf(symbols, sizeof symbols, "%s", "abcdefghijklmnopqrstuvwxyz0123456789-+_=.ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
snprintf(symbols, sizeof symbols, "%s", "abcdefghijklmnopqrstuvwxyz0123456789-+_=.ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||||
@@ -415,7 +416,6 @@ void parse_parameters(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
BUFSIZE = atoi(optarg);
|
BUFSIZE = atoi(optarg);
|
||||||
info("Buffer size set to: %d.\n", BUFSIZE);
|
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
BANFILE = optarg;
|
BANFILE = optarg;
|
||||||
@@ -423,14 +423,12 @@ void parse_parameters(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
SLUG_SIZE = atoi(optarg);
|
SLUG_SIZE = atoi(optarg);
|
||||||
info("Slug size set to: %d.\n", SLUG_SIZE);
|
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
BASEDIR = optarg;
|
BASEDIR = optarg;
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
LOG = optarg;
|
LOG = optarg;
|
||||||
info("Log file: %s\n", LOG);
|
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
set_uid_gid(optarg);
|
set_uid_gid(optarg);
|
||||||
|
|||||||
Reference in New Issue
Block a user