diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-01-17 00:32:29 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-01-17 00:43:09 +0100 |
commit | f5fb7c713ea443469406a691e60a6f4567a4cb75 (patch) | |
tree | b16d979915b5ad7e32ffe77ca5f5006dc639a16e /exec | |
parent | dd3048b2e483f66571cfa1b2ccebb2091b9ad990 (diff) | |
download | hurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.tar.gz hurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.tar.bz2 hurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.zip |
Fix const warnings
Now that the RPCs have const, this forces us cleaning our const-meant
functions.
Diffstat (limited to 'exec')
-rw-r--r-- | exec/exec.c | 30 | ||||
-rw-r--r-- | exec/hashexec.c | 6 | ||||
-rw-r--r-- | exec/priv.h | 6 |
3 files changed, 22 insertions, 20 deletions
diff --git a/exec/exec.c b/exec/exec.c index 06589df9..a50ea632 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -788,8 +788,8 @@ static error_t do_exec (file_t file, task_t oldtask, int flags, - char *path, - char *abspath, + const_string_t path, + const_string_t abspath, char *argv, mach_msg_type_number_t argvlen, boolean_t argv_copy, char *envp, mach_msg_type_number_t envplen, boolean_t envp_copy, mach_port_t *dtable, mach_msg_type_number_t dtablesize, @@ -797,8 +797,8 @@ do_exec (file_t file, mach_port_t *portarray, mach_msg_type_number_t nports, boolean_t portarray_copy, int *intarray, mach_msg_type_number_t nints, boolean_t intarray_copy, - mach_port_t *deallocnames, mach_msg_type_number_t ndeallocnames, - mach_port_t *destroynames, mach_msg_type_number_t ndestroynames) + const mach_port_t *deallocnames, mach_msg_type_number_t ndeallocnames, + const mach_port_t *destroynames, mach_msg_type_number_t ndestroynames) { struct execdata e, interp; task_t newtask = MACH_PORT_NULL; @@ -1585,12 +1585,14 @@ S_exec_exec_paths (struct trivfs_protid *protid, /* There were no user-specified exec servers, or none of them could be found. */ + /* For some of the arrays, we deallocate by hand, thus dropping const. */ + return do_exec (file, oldtask, flags, path, abspath, - argv, argvlen, argv_copy, - envp, envplen, envp_copy, - dtable, dtablesize, dtable_copy, - portarray, nports, portarray_copy, - intarray, nints, intarray_copy, + (char*) argv, argvlen, argv_copy, + (char*) envp, envplen, envp_copy, + (mach_port_t*) dtable, dtablesize, dtable_copy, + (mach_port_t*) portarray, nports, portarray_copy, + (int*) intarray, nints, intarray_copy, deallocnames, ndeallocnames, destroynames, ndestroynames); } @@ -1609,13 +1611,13 @@ S_exec_setexecdata (struct trivfs_protid *protid, return EINVAL; /* */ err = 0; - ports = servercopy (ports, nports * sizeof (mach_port_t), ports_copy, &err); + ports = servercopy ((mach_port_t*) ports, nports * sizeof (mach_port_t), ports_copy, &err); if (err) return err; - ints = servercopy (ints, nints * sizeof (int), ints_copy, &err); + ints = servercopy ((int*) ints, nints * sizeof (int), ints_copy, &err); if (err) { - munmap (ports, nports * sizeof (mach_port_t)); + munmap ((void*) ports, nports * sizeof (mach_port_t)); return err; } @@ -1629,13 +1631,13 @@ S_exec_setexecdata (struct trivfs_protid *protid, munmap (std_ports, std_nports * sizeof (mach_port_t)); } - std_ports = ports; + std_ports = (mach_port_t*) ports; std_nports = nports; if (std_ints) munmap (std_ints, std_nints * sizeof (int)); - std_ints = ints; + std_ints = (int*) ints; std_nints = nints; pthread_rwlock_unlock (&std_lock); diff --git a/exec/hashexec.c b/exec/hashexec.c index 71c02386..9cd5392b 100644 --- a/exec/hashexec.c +++ b/exec/hashexec.c @@ -36,14 +36,14 @@ check_hashbang (struct execdata *e, file_t file, task_t oldtask, int flags, - char *file_name_exec, + const char *file_name_exec, char *argv, u_int argvlen, boolean_t argv_copy, char *envp, u_int envplen, boolean_t envp_copy, mach_port_t *dtable, u_int dtablesize, boolean_t dtable_copy, mach_port_t *portarray, u_int nports, boolean_t portarray_copy, int *intarray, u_int nints, boolean_t intarray_copy, - mach_port_t *deallocnames, u_int ndeallocnames, - mach_port_t *destroynames, u_int ndestroynames) + const mach_port_t *deallocnames, u_int ndeallocnames, + const mach_port_t *destroynames, u_int ndestroynames) { char *p; char *interp, *arg; /* Interpreter file name, and first argument */ diff --git a/exec/priv.h b/exec/priv.h index 07df6e8c..6077932c 100644 --- a/exec/priv.h +++ b/exec/priv.h @@ -136,7 +136,7 @@ void check_hashbang (struct execdata *e, file_t file, task_t oldtask, int flags, - char *filename, + const char *filename, char *argv, u_int argvlen, boolean_t argv_copy, char *envp, u_int envplen, boolean_t envp_copy, mach_port_t *dtable, u_int dtablesize, @@ -144,8 +144,8 @@ void check_hashbang (struct execdata *e, mach_port_t *portarray, u_int nports, boolean_t portarray_copy, int *intarray, u_int nints, boolean_t intarray_copy, - mach_port_t *deallocnames, u_int ndeallocnames, - mach_port_t *destroynames, u_int ndestroynames); + const mach_port_t *deallocnames, u_int ndeallocnames, + const mach_port_t *destroynames, u_int ndestroynames); /* Standard exec data for secure execs. */ |