]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - server.c
Do not call vss_post_select() if para_select() failed.
[paraslash.git] / server.c
index 90dfc1f58962f69355775fd87e4c08f8253efeac..ee1638d52b24633315600c5209215eb0df2204f7 100644 (file)
--- a/server.c
+++ b/server.c
@@ -257,8 +257,9 @@ static void parse_config(int override)
                struct server_cmdline_parser_params params = {
                        .override = override,
                        .initialize = 0,
-                       .check_required = 0,
-                       .check_ambiguity = 0
+                       .check_required = 1,
+                       .check_ambiguity = 0,
+                       .print_errors = 1
                };
                server_cmdline_parser_config_file(cf, &conf, &params);
                conf.daemon_given = tmp;
@@ -379,10 +380,16 @@ static unsigned server_init(int argc, char **argv)
 {
        /* connector's address information */
        int sockfd;
-
+       struct server_cmdline_parser_params params = {
+               .override = 0,
+               .initialize = 1,
+               .check_required = 0,
+               .check_ambiguity = 0,
+               .print_errors = 1
+       };
        init_random_seed();
        /* parse command line options */
-       server_cmdline_parser(argc, argv, &conf);
+       server_cmdline_parser_ext(argc, argv, &conf, &params);
        HANDLE_VERSION_FLAG("server", conf);
        para_drop_privileges(conf.user_arg, conf.group_arg);
        /* parse config file, open log and set defaults */
@@ -485,9 +492,9 @@ repeat:
        mmd_unlock();
        ret = para_select(max_fileno + 1, &rfds, &wfds, timeout);
        mmd_lock();
-       vss_post_select(&rfds, &wfds);
        if (ret < 0)
                goto repeat;
+       vss_post_select(&rfds, &wfds);
        for (i = 0; senders[i].name; i++) {
                if (!senders[i].post_select)
                        continue;