kill unused E_LIST_WRITERS_GIVEN
[paraslash.git] / server.c
index 2f66dc4..e10c1e0 100644 (file)
--- a/server.c
+++ b/server.c
@@ -135,15 +135,7 @@ void para_log(int ll, const char* fmt,...)
 
        if (ll < conf.loglevel_arg)
                return;
-       if (!logfile) {
-               if (ll < WARNING)
-                       outfd = stdout;
-               else
-                       outfd = stderr;
-       } else
-               outfd = logfile;
-       if (conf.daemon_given && !logfile)
-               return;
+       outfd = logfile? logfile : stderr;
        time(&t1);
        tm = localtime(&t1);
        strftime(str, MAXLINE, "%b %d %H:%M:%S", tm);
@@ -269,7 +261,6 @@ static void setup_signal_handling(void)
        int ret = 0;
 
        signal_pipe = para_signal_init();
-//     fcntl(signal_pipe, F_SETFL, O_NONBLOCK);
        PARA_NOTICE_LOG("%s", "setting up signal handlers\n");
        ret += para_install_sighandler(SIGINT);
        ret += para_install_sighandler(SIGTERM);
@@ -349,7 +340,7 @@ static unsigned do_inits(int argc, char **argv)
        init_random_seed();
        /* parse command line options */
        cmdline_parser(argc, argv, &conf);
-       para_drop_privileges(conf.user_arg);
+       para_drop_privileges(conf.user_arg, conf.group_arg);
        /* parse config file, open log and set defaults */
        parse_config(0);
        log_welcome("para_server", conf.loglevel_arg);
@@ -451,7 +442,7 @@ repeat:
        FD_SET(sockfd, &rfds);
        max_fileno = sockfd;
        FD_SET(signal_pipe, &rfds);
-       max_fileno = MAX(max_fileno, signal_pipe);
+       max_fileno = PARA_MAX(max_fileno, signal_pipe);
 
        timeout = afs_preselect();
        status_refresh();
@@ -467,7 +458,7 @@ repeat:
        }
        if (selectors[mmd->selector_num].pre_select) {
                ret = selectors[mmd->selector_num].pre_select(&rfds, &wfds);
-               max_fileno = MAX(max_fileno, ret);
+               max_fileno = PARA_MAX(max_fileno, ret);
        }
        mmd_unlock();
        ret = para_select(max_fileno + 1, &rfds, &wfds, timeout);