diff options
| author | Nora Schiffer | 2026-02-09 23:30:35 +0000 |
|---|---|---|
| committer | Nora Schiffer | 2026-02-20 21:55:58 +0000 |
| commit | 4e4a34b1a833505ad274d973b3e86c8b5ebcdd8d (patch) | |
| tree | 1f9f28768a3b14d3b717535857adb12ec2906a18 | |
| parent | 180ffccf79d1a1a2c3eb644e26f6d87b1cbcfffd (diff) | |
rcS, ubus: constify char * arguments and variables where appropriate
Signed-off-by: Nora Schiffer <neocturne@universe-factory.net>
| -rw-r--r-- | procd.h | 2 | ||||
| -rw-r--r-- | rcS.c | 10 | ||||
| -rw-r--r-- | rcS.h | 4 | ||||
| -rw-r--r-- | ubus.c | 2 |
4 files changed, 9 insertions, 9 deletions
@@ -27,7 +27,7 @@ #define __init __attribute__((constructor)) -extern char *ubus_socket; +extern const char *ubus_socket; void procd_connect_ubus(void); void procd_reconnect_ubus(int reconnect); @@ -125,7 +125,7 @@ static void q_initd_complete(struct runqueue *q, struct runqueue_task *p) free(s); } -static bool find_runqueue_list_entry(struct list_head *list, char *file, char *param) +static bool find_runqueue_list_entry(struct list_head *list, const char *file, const char *param) { struct initd *s; @@ -135,7 +135,7 @@ static bool find_runqueue_list_entry(struct list_head *list, char *file, char *p return false; } -static void add_initd(struct runqueue *q, char *file, char *param) +static void add_initd(struct runqueue *q, const char *file, const char *param) { static const struct runqueue_task_type initd_type = { .run = q_initd_run, @@ -168,7 +168,7 @@ static void add_initd(struct runqueue *q, char *file, char *param) runqueue_task_add(q, &s->proc.task, false); } -static int _rc(struct runqueue *q, char *path, const char *file, char *pattern, char *param) +static int _rc(struct runqueue *q, const char *path, const char *file, const char *pattern, const char *param) { char *dir = alloca(2 + strlen(path) + strlen(file) + strlen(pattern)); glob_t gl; @@ -194,7 +194,7 @@ static int _rc(struct runqueue *q, char *path, const char *file, char *pattern, return 0; } -int rcS(char *pattern, char *param, void (*q_empty)(struct runqueue *)) +int rcS(const char *pattern, const char *param, void (*q_empty)(struct runqueue *)) { runqueue_init(&q); q.empty_cb = q_empty; @@ -203,7 +203,7 @@ int rcS(char *pattern, char *param, void (*q_empty)(struct runqueue *)) return _rc(&q, "/etc/rc.d", pattern, "*", param); } -int rc(const char *file, char *param) +int rc(const char *file, const char *param) { return _rc(&r, "/etc/init.d", file, "", param); } @@ -17,7 +17,7 @@ #include <libubox/runqueue.h> -extern int rcS(char *pattern, char *param, void (*q_empty)(struct runqueue *)); -extern int rc(const char *file, char *param); +extern int rcS(const char *pattern, const char *param, void (*q_empty)(struct runqueue *)); +extern int rc(const char *file, const char *param); #endif @@ -19,7 +19,7 @@ #include "procd.h" -char *ubus_socket = NULL; +const char *ubus_socket = NULL; static struct ubus_context *ctx; static struct uloop_timeout ubus_timer; static int timeout; |