diff options
author | Maria Matejka <mq@jmq.cz> | 2020-04-08 22:25:15 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2020-04-09 15:37:14 +0200 |
commit | fd9f0c0640fd02a26b96b4f9d3cbbffbb6544a84 (patch) | |
tree | 3cfac115f49d41f3d62d41c4ddfffe50f2c381a4 /sysdep/unix | |
parent | a109056145a6bc8a6b498ecb6e309ebc143c8b3c (diff) |
Configuration strings are constant.
This is merely a const propagation. There was no problem in there.
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/io.c | 2 | ||||
-rw-r--r-- | sysdep/unix/log.c | 4 | ||||
-rw-r--r-- | sysdep/unix/main.c | 8 | ||||
-rw-r--r-- | sysdep/unix/unix.h | 12 |
4 files changed, 13 insertions, 13 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index f4e45a5f..f6cc0e32 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -91,7 +91,7 @@ static struct resclass rf_class = { }; struct rfile * -rf_open(pool *p, char *name, char *mode) +rf_open(pool *p, const char *name, const char *mode) { FILE *f = fopen(name, mode); diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c index 18894f98..e24322c6 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -332,7 +332,7 @@ debug(const char *msg, ...) } static list * -default_log_list(int initial, char **syslog_name) +default_log_list(int initial, const char **syslog_name) { static list log_list; init_list(&log_list); @@ -365,7 +365,7 @@ default_log_list(int initial, char **syslog_name) } void -log_switch(int initial, list *logs, char *new_syslog_name) +log_switch(int initial, list *logs, const char *new_syslog_name) { struct log_config *l; diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 5209b9b3..1d258f4c 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -190,7 +190,7 @@ sysdep_commit(struct config *new, struct config *old UNUSED) } static int -unix_read_config(struct config **cp, char *name) +unix_read_config(struct config **cp, const char *name) { struct config *conf = config_alloc(name); int ret; @@ -240,7 +240,7 @@ async_config(void) } static struct config * -cmd_read_config(char *name) +cmd_read_config(const char *name) { struct config *conf; @@ -262,7 +262,7 @@ cmd_read_config(char *name) } void -cmd_check_config(char *name) +cmd_check_config(const char *name) { struct config *conf = cmd_read_config(name); if (!conf) @@ -303,7 +303,7 @@ cmd_reconfig_undo_notify(void) } void -cmd_reconfig(char *name, int type, uint timeout) +cmd_reconfig(const char *name, int type, uint timeout) { if (cli_access_restricted()) return; diff --git a/sysdep/unix/unix.h b/sysdep/unix/unix.h index bd817bf2..8244fc86 100644 --- a/sysdep/unix/unix.h +++ b/sysdep/unix/unix.h @@ -23,8 +23,8 @@ extern char *bird_name; void async_config(void); void async_dump(void); void async_shutdown(void); -void cmd_check_config(char *name); -void cmd_reconfig(char *name, int type, uint timeout); +void cmd_check_config(const char *name); +void cmd_reconfig(const char *name, int type, uint timeout); void cmd_reconfig_confirm(void); void cmd_reconfig_undo(void); void cmd_reconfig_status(void); @@ -106,7 +106,7 @@ void io_init(void); void io_loop(void); void io_log_dump(void); int sk_open_unix(struct birdsock *s, char *name); -struct rfile *rf_open(struct pool *, char *name, char *mode); +struct rfile *rf_open(struct pool *, const char *name, const char *mode); void *rf_file(struct rfile *f); int rf_fileno(struct rfile *f); void test_old_bird(char *path); @@ -119,15 +119,15 @@ void krt_io_init(void); void main_thread_init(void); void log_init_debug(char *); /* Initialize debug dump to given file (NULL=stderr, ""=off) */ -void log_switch(int initial, list *l, char *); +void log_switch(int initial, list *l, const char *); struct log_config { node n; uint mask; /* Classes to log */ void *fh; /* FILE to log to, NULL=syslog */ struct rfile *rf; /* Resource for log file */ - char *filename; /* Log filename */ - char *backup; /* Secondary filename (for log rotation) */ + const char *filename; /* Log filename */ + const char *backup; /* Secondary filename (for log rotation) */ off_t pos; /* Position/size of current log */ off_t limit; /* Log size limit */ int terminal_flag; |