X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=server.c;h=e0d50f4f8689e1de283ef80f8341504bcf386d33;hb=refs%2Fheads%2Fpu;hp=2852ee1f10f7a9d8d4f5a93e2233b8b6fd4a4ecc;hpb=5967ac5353739c3ff571dd12d4c6814fa8493ad8;p=paraslash.git diff --git a/server.c b/server.c index 2852ee1f..229a146d 100644 --- a/server.c +++ b/server.c @@ -228,18 +228,12 @@ void parse_config_or_die(bool reload) daemon_set_flag(DF_LOG_TIMING); daemon_set_priority(OPT_UINT32_VAL(PRIORITY)); if (!reload || getpid() != afs_pid) { - char *user_list_file; - if (OPT_GIVEN(USER_LIST)) - user_list_file = para_strdup(OPT_STRING_VAL(USER_LIST)); - else { - char *home = para_homedir(); - user_list_file = make_message("%s/.paraslash/server.users", home); - free(home); - } + char *user_list_file = OPT_GIVEN(USER_LIST)? + para_strdup(OPT_STRING_VAL(USER_LIST)) : + make_message("%s/server.users", get_confdir()); user_list_init(user_list_file); free(user_list_file); } - return; } /* @@ -436,14 +430,14 @@ static void init_server_command_task(struct server_command_task *sct, sct->argv = argv; if (!OPT_GIVEN(LISTEN_ADDRESS)) { sct->num_listen_fds = 1; - sct->listen_fds = para_malloc(sizeof(int)); + sct->listen_fds = alloc(sizeof(int)); ret = para_listen_simple(IPPROTO_TCP, port); if (ret < 0) goto err; sct->listen_fds[0] = ret; } else { sct->num_listen_fds = OPT_GIVEN(LISTEN_ADDRESS); - sct->listen_fds = para_malloc(sct->num_listen_fds * sizeof(int)); + sct->listen_fds = alloc(sct->num_listen_fds * sizeof(int)); for (n = 0; n < OPT_GIVEN(LISTEN_ADDRESS); n++) { const char *arg; arg = lls_string_val(n, OPT_RESULT(LISTEN_ADDRESS)); @@ -693,5 +687,6 @@ int main(int argc, char *argv[]) shm_detach(mmd); user_list_deplete(); free_lpr(); + free(get_confdir()); exit(ret < 0? EXIT_FAILURE : EXIT_SUCCESS); }