summaryrefslogtreecommitdiff
path: root/threadproc
diff options
context:
space:
mode:
authorgstein <gstein@13f79535-47bb-0310-9956-ffa450edef68>2000-11-26 02:03:12 +0000
committergstein <gstein@13f79535-47bb-0310-9956-ffa450edef68>2000-11-26 02:03:12 +0000
commite835ddb3ff7dcf31a243bde6b9e1e081230510bc (patch)
tree6e4f5caabd00445ae67d2b4b027b0957939fc3b5 /threadproc
parent0c28de09335c038f21472452bcf4ede4afa23da8 (diff)
downloadlibapr-e835ddb3ff7dcf31a243bde6b9e1e081230510bc.tar.gz
The arguments to apr_create_process() should be "const" since we aren't
going to change them. It is also quite possible that args are constant strings (thus, we *definitely* better not change them). "env" got the same treatment. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60795 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r--threadproc/beos/proc.c9
-rw-r--r--threadproc/os2/proc.c5
-rw-r--r--threadproc/unix/proc.c9
-rw-r--r--threadproc/win32/proc.c5
4 files changed, 16 insertions, 12 deletions
diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
index 51a2e5eb7..0a75d43cc 100644
--- a/threadproc/beos/proc.c
+++ b/threadproc/beos/proc.c
@@ -202,16 +202,17 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont)
apr_status_t apr_create_process(apr_proc_t *new, const char *progname,
- char *const args[], char **env,
- apr_procattr_t *attr, apr_pool_t *cont)
+ const char * const *args,
+ const char * const *env,
+ apr_procattr_t *attr, apr_pool_t *cont)
{
int i=0,nargs=0;
char **newargs = NULL;
thread_id newproc, sender;
struct send_pipe *sp;
- char * dir = NULL;
+ char * dir = NULL;
- sp = (struct send_pipe *)apr_palloc(cont, sizeof(struct send_pipe));
+ sp = (struct send_pipe *)apr_palloc(cont, sizeof(struct send_pipe));
new->in = attr->parent_in;
new->err = attr->parent_err;
diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
index 4a88675cc..12d214d93 100644
--- a/threadproc/os2/proc.c
+++ b/threadproc/os2/proc.c
@@ -279,8 +279,9 @@ static char *double_quotes(apr_pool_t *cntxt, char *str)
apr_status_t apr_create_process(apr_proc_t *proc, const char *progname,
- char *const args[], char **env,
- apr_procattr_t *attr, apr_pool_t *cont)
+ const char * const *args,
+ const char * const *env,
+ apr_procattr_t *attr, apr_pool_t *cont)
{
int i, arg, numargs, cmdlen;
apr_status_t status;
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index c826a755b..311b7520b 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -271,8 +271,9 @@ static apr_status_t limit_proc(apr_procattr_t *attr)
}
apr_status_t apr_create_process(apr_proc_t *new, const char *progname,
- char *const *args, char **env,
- apr_procattr_t *attr, apr_pool_t *cont)
+ const char * const *args,
+ const char * const *env,
+ apr_procattr_t *attr, apr_pool_t *cont)
{
int i;
const char **newargs;
@@ -334,13 +335,13 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname,
if (attr->detached) {
apr_detach();
}
- execve(SHELL_PATH, (char **) newargs, env);
+ execve(SHELL_PATH, (char * const *) newargs, (char * const *)env);
}
else {
if (attr->detached) {
apr_detach();
}
- execve(progname, args, env);
+ execve(progname, (char * const *)args, (char * const *)env);
}
exit(-1); /* if we get here, there is a problem, so exit with an */
/* error code. */
diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
index e230b5a97..a45928f30 100644
--- a/threadproc/win32/proc.c
+++ b/threadproc/win32/proc.c
@@ -235,8 +235,9 @@ apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t det)
}
apr_status_t apr_create_process(apr_proc_t *new, const char *progname,
- char *const args[], char **env,
- apr_procattr_t *attr, apr_pool_t *cont)
+ const char * const *args,
+ const char * const *env,
+ apr_procattr_t *attr, apr_pool_t *cont)
{
int i, iEnvBlockLen;
char *cmdline;