From a9f37d2597917c85d4ef914b846ebc69c6478a03 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Tue, 20 Jun 2023 11:42:30 +0000 Subject: [PATCH] libroken: Make roken_detach_prep take const char *special_arg. Requires an internal rk_UNCONST because of annoying execvp type, but that's better than rk_UNCONST in all the call sites. --- lib/roken/detach.c | 4 ++-- lib/roken/roken.h.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/roken/detach.c b/lib/roken/detach.c index 4a0068251..a9e5116c9 100644 --- a/lib/roken/detach.c +++ b/lib/roken/detach.c @@ -45,7 +45,7 @@ static int pipefds[2] = {-1, -1}; ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL -roken_detach_prep(int argc, char **argv, char *special_arg) +roken_detach_prep(int argc, char **argv, const char *special_arg) { ssize_t bytes; size_t i; @@ -84,7 +84,7 @@ roken_detach_prep(int argc, char **argv, char *special_arg) pipefds[1]); new_argv[0] = argv[0]; - new_argv[1] = special_arg; + new_argv[1] = rk_UNCONST(special_arg); new_argv[2] = fildes; for (i = 1; argv[i] != NULL; i++) new_argv[i + 2] = argv[i]; diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 5d8cac61c..31847ce8b 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -922,7 +922,7 @@ ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL roken_vconcat (char *, size_t, va_list); ROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL roken_vmconcat (char **, size_t, va_list); -ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL roken_detach_prep(int, char **, char *); +ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL roken_detach_prep(int, char **, const char *); ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL roken_detach_finish(const char *, int); ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL