diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-10-09 16:24:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-09 16:24:59 +0200 |
commit | 9369b380423fbe785d40d80a1c3ad06ad980394b (patch) | |
tree | efc46774e2b7109f9dc1a87b69bcb282f7c0ad84 | |
parent | 8700665099c7d502c43af9e3abe55ba181495145 (diff) | |
parent | 0184d235b37ee09d3c17ba14cde414962eedfdca (diff) |
Merge pull request #173 from nbd168/misc-fixes
Misc fixes
-rw-r--r-- | include/ucode/platform.h | 4 | ||||
-rw-r--r-- | lib/uloop.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/ucode/platform.h b/include/ucode/platform.h index 52eb391..ef244c6 100644 --- a/include/ucode/platform.h +++ b/include/ucode/platform.h @@ -61,12 +61,12 @@ __hidden int pipe2(int[2], int); __hidden int sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *); static inline int -execvpe(const char *program, char **argv, char **envp) +execvpe(const char *program, char * const *argv, char * const *envp) { char **saved = environ; int rc; - environ = envp; + environ = (char **)envp; rc = execvp(program, argv); environ = saved; diff --git a/lib/uloop.c b/lib/uloop.c index d8d702f..c4b1105 100644 --- a/lib/uloop.c +++ b/lib/uloop.c @@ -490,7 +490,7 @@ uc_uloop_process(uc_vm_t *vm, size_t nargs) { uc_value_t *executable = uc_fn_arg(0); uc_value_t *arguments = uc_fn_arg(1); - uc_value_t *environ = uc_fn_arg(2); + uc_value_t *env_arg = uc_fn_arg(2); uc_value_t *callback = uc_fn_arg(3); uc_uloop_process_t *process; uc_stringbuf_t *buf; @@ -501,7 +501,7 @@ uc_uloop_process(uc_vm_t *vm, size_t nargs) if (ucv_type(executable) != UC_STRING || (arguments && ucv_type(arguments) != UC_ARRAY) || - (environ && ucv_type(environ) != UC_OBJECT) || + (env_arg && ucv_type(env_arg) != UC_OBJECT) || !ucv_is_callable(callback)) { err_return(EINVAL); } @@ -513,7 +513,7 @@ uc_uloop_process(uc_vm_t *vm, size_t nargs) if (pid == 0) { argp = calloc(ucv_array_length(arguments) + 2, sizeof(char *)); - envp = calloc(ucv_object_length(environ) + 1, sizeof(char *)); + envp = calloc(ucv_object_length(env_arg) + 1, sizeof(char *)); if (!argp || !envp) _exit(-1); @@ -525,7 +525,7 @@ uc_uloop_process(uc_vm_t *vm, size_t nargs) i = 0; - ucv_object_foreach(environ, envk, envv) { + ucv_object_foreach(env_arg, envk, envv) { buf = xprintbuf_new(); ucv_stringbuf_printf(buf, "%s=", envk); |