From: Andre Noll Date: Tue, 21 Jun 2016 21:27:54 +0000 (+0200) Subject: daemon: Constify argument of two functions. X-Git-Tag: v0.5.6~2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=92d85d340495154f3fda23f322af13fc9de42155;ds=sidebyside daemon: Constify argument of two functions. daemon_set_logfile() and daemon_set_loglevel() do not modify the passed string, so the type of the argument should be const char *. --- diff --git a/daemon.c b/daemon.c index 5a92451a..945c5a39 100644 --- a/daemon.c +++ b/daemon.c @@ -122,7 +122,7 @@ void daemon_init_colors_or_die(int color_arg, int color_arg_auto, * * \param logfile_name The full path of the logfile. */ -void daemon_set_logfile(char *logfile_name) +void daemon_set_logfile(const char *logfile_name) { free(me->logfile_name); me->logfile_name = NULL; @@ -135,7 +135,7 @@ void daemon_set_logfile(char *logfile_name) * * \param loglevel The smallest level that should be logged. */ -void daemon_set_loglevel(char *loglevel) +void daemon_set_loglevel(const char *loglevel) { int ret = get_loglevel_by_name(loglevel); diff --git a/daemon.h b/daemon.h index 621420a4..e97678d6 100644 --- a/daemon.h +++ b/daemon.h @@ -10,9 +10,9 @@ void daemon_drop_privileges_or_die(const char *username, const char *groupname); void daemon_set_start_time(void); time_t daemon_get_uptime(const struct timeval *current_time); __malloc char *daemon_get_uptime_str(const struct timeval *current_time); -void daemon_set_logfile(char *logfile_name); +void daemon_set_logfile(const char *logfile_name); void daemon_set_flag(unsigned flag); -void daemon_set_loglevel(char *loglevel); +void daemon_set_loglevel(const char *loglevel); void daemon_init_colors_or_die(int color_arg, int color_arg_auto, int color_arg_no, bool logfile_given, char **log_color_argv, int argc);