Index: src/log.c =================================================================== --- src/log.c (revision 349) +++ src/log.c (revision 396) @@ -63,7 +63,7 @@ } -struct log_resource* log_build_resources(char *filename) +struct log_resource* log_build_resources(const char *filename) { struct log_resource *resource; resource = (struct log_resource *) malloc(sizeof(struct log_resource)); Index: src/main.c =================================================================== --- src/main.c (revision 349) +++ src/main.c (revision 396) @@ -48,6 +48,7 @@ #include "loop.h" #include "imscreen.h" +const char *amora_default_logfile = "amora.log"; /** Amora global struct that holds the main resources */ struct amora_s { @@ -142,7 +143,8 @@ int server_socket, client_socket, channel = 10, res; int clean_up = 0; struct service_description *sd = NULL; - char arg, *logfile = NULL; + char arg; + const char *logfile = NULL; if (argc > 4) { show_usage(argv[0]); @@ -167,9 +169,8 @@ } if (!logfile) - logfile = "amora.log"; + logfile = amora_default_logfile; - amora.log = log_build_resources(logfile); if (check_device() < 0) { @@ -491,10 +492,10 @@ printf("Usage: %s [-l logfile] [-h] [-v]\n" "\n" - " -h show this help message.\n" - " -l logfile set the log file path.\n" - " -v version show version.\n" - "\n", name); + " -h show this help message and exit;\n" + " -l logfile set the log file path (default is %s);\n" + " -v show version and exit.\n" + "\n", name, amora_default_logfile); free(p); } Index: src/log.h =================================================================== --- src/log.h (revision 349) +++ src/log.h (revision 396) @@ -68,7 +68,7 @@ * * @param filename Path and filename for log file. */ -struct log_resource* log_build_resources(char *filename); +struct log_resource* log_build_resources(const char *filename); /** Deallocate log resource structure.