client: Fix loglevel setting.
[paraslash.git] / client_common.c
index 39eb8b4cce9f6403132329fd0edfbf7b7025caaf..fce5483aee60da60e1db320812aa687c7c8c6f7b 100644 (file)
@@ -1,8 +1,4 @@
-/*
- * Copyright (C) 1997 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 1997 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
 
 /** \file client_common.c Common functions of para_client and para_audiod. */
 
@@ -540,7 +536,6 @@ int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr,
        ret = lls(lls_parse(argc, argv, cmd, &lpr, &errctx));
        if (ret < 0)
                goto out;
-       ll = CLIENT_OPT_UINT32_VAL(LOGLEVEL, lpr);
        version_handle_flag("client", CLIENT_OPT_GIVEN(VERSION, lpr));
        handle_help_flag(lpr);
 
@@ -577,6 +572,9 @@ int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr,
                lpr = merged_lpr;
        }
        /* success */
+       ll = CLIENT_OPT_UINT32_VAL(LOGLEVEL, lpr);
+       if (loglevel)
+               *loglevel = ll;
        user = CLIENT_OPT_GIVEN(USER, lpr)?
                para_strdup(CLIENT_OPT_STRING_VAL(USER, lpr)) : para_logname();
 
@@ -600,8 +598,6 @@ int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr,
        ct->config_file = cf;
        ct->user = user;
        *ct_ptr = ct;
-       if (loglevel)
-               *loglevel = ll;
        ret = lls_num_inputs(lpr);
 out:
        free(home);