gstein 00/11/25 18:03:13
Modified: include apr_thread_proc.h
threadproc/beos proc.c
threadproc/os2 proc.c
threadproc/unix proc.c
threadproc/win32 proc.c
Log:
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.
Revision Changes Path
1.47 +3 -2 apr/include/apr_thread_proc.h
Index: apr_thread_proc.h
===================================================================
RCS file: /home/cvs/apr/include/apr_thread_proc.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -u -r1.46 -r1.47
--- apr_thread_proc.h 2000/11/09 21:11:37 1.46
+++ apr_thread_proc.h 2000/11/26 02:03:09 1.47
@@ -378,8 +378,9 @@
* @param cont The pool to use.
*/
apr_status_t apr_create_process(apr_proc_t *new_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);
/**
* Wait for a child process to die
1.34 +5 -4 apr/threadproc/beos/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/beos/proc.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -u -r1.33 -r1.34
--- proc.c 2000/11/19 01:05:16 1.33
+++ proc.c 2000/11/26 02:03:10 1.34
@@ -202,16 +202,17 @@
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;
1.34 +3 -2 apr/threadproc/os2/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/os2/proc.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -u -r1.33 -r1.34
--- proc.c 2000/11/14 06:40:07 1.33
+++ proc.c 2000/11/26 02:03:11 1.34
@@ -279,8 +279,9 @@
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;
1.41 +5 -4 apr/threadproc/unix/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/unix/proc.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -u -r1.40 -r1.41
--- proc.c 2000/11/09 06:47:53 1.40
+++ proc.c 2000/11/26 02:03:12 1.41
@@ -271,8 +271,9 @@
}
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 @@
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. */
1.39 +3 -2 apr/threadproc/win32/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/win32/proc.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -u -r1.38 -r1.39
--- proc.c 2000/11/09 06:47:54 1.38
+++ proc.c 2000/11/26 02:03:12 1.39
@@ -235,8 +235,9 @@
}
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;