Loading src/server/mwserv.c +11 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ static void usage(char *name) "[--foreground|-f]" "[--port|-p <port>]" "[--print-config|-P]" "[--debug|-D]" "\n", name); } Loading @@ -40,6 +41,7 @@ static const struct cfg_default_opt defcfgs[] = { CFG_OPT(BOOL, "foreground", 0), CFG_OPT(INT, "port", 9999), CFG_OPT(STR, "user", MWUSER), CFG_OPT(BOOL, "debug", 0), CFG_END }; Loading Loading @@ -78,6 +80,7 @@ static int getconfig(int argc, char **argv) static struct option loptspec[] = { {"config", required_argument, 0, 'c'}, {"foreground", no_argument, 0, 'f'}, {"debug", no_argument, 0, 'D'}, {"help", no_argument, 0, 'h'}, {"print-config", no_argument, 0, 'P'}, {"port", required_argument, 0, 'p'}, Loading @@ -89,7 +92,7 @@ static int getconfig(int argc, char **argv) return ret; while (1) { c = getopt_long(argc, argv, "c:fhPp:", loptspec, &optidx); c = getopt_long(argc, argv, "c:fDhPp:", loptspec, &optidx); if (c == -1) break; Loading @@ -115,6 +118,9 @@ static int getconfig(int argc, char **argv) case 'f': cfg_set_bool("foreground", 1); break; case 'D': cfg_set_bool("debug", 1); break; case 'h': usage(argv[0]); exit(0); Loading Loading @@ -176,6 +182,10 @@ int main(int argc, char **argv) } migrate_old_folders(); if (!cfg_get_bool("debug")) { freopen("/dev/null", "w", stdout); freopen("/dev/null", "w", stderr); } if (cfg_get_bool("foreground")) setlinebuf(stdout); else Loading Loading
src/server/mwserv.c +11 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ static void usage(char *name) "[--foreground|-f]" "[--port|-p <port>]" "[--print-config|-P]" "[--debug|-D]" "\n", name); } Loading @@ -40,6 +41,7 @@ static const struct cfg_default_opt defcfgs[] = { CFG_OPT(BOOL, "foreground", 0), CFG_OPT(INT, "port", 9999), CFG_OPT(STR, "user", MWUSER), CFG_OPT(BOOL, "debug", 0), CFG_END }; Loading Loading @@ -78,6 +80,7 @@ static int getconfig(int argc, char **argv) static struct option loptspec[] = { {"config", required_argument, 0, 'c'}, {"foreground", no_argument, 0, 'f'}, {"debug", no_argument, 0, 'D'}, {"help", no_argument, 0, 'h'}, {"print-config", no_argument, 0, 'P'}, {"port", required_argument, 0, 'p'}, Loading @@ -89,7 +92,7 @@ static int getconfig(int argc, char **argv) return ret; while (1) { c = getopt_long(argc, argv, "c:fhPp:", loptspec, &optidx); c = getopt_long(argc, argv, "c:fDhPp:", loptspec, &optidx); if (c == -1) break; Loading @@ -115,6 +118,9 @@ static int getconfig(int argc, char **argv) case 'f': cfg_set_bool("foreground", 1); break; case 'D': cfg_set_bool("debug", 1); break; case 'h': usage(argv[0]); exit(0); Loading Loading @@ -176,6 +182,10 @@ int main(int argc, char **argv) } migrate_old_folders(); if (!cfg_get_bool("debug")) { freopen("/dev/null", "w", stdout); freopen("/dev/null", "w", stderr); } if (cfg_get_bool("foreground")) setlinebuf(stdout); else Loading