diff options
| author | bwarsaw | 1999-10-29 15:06:43 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-10-29 15:06:43 +0000 |
| commit | be6a91338ad142d19b2d4bf9c81c300dd76e5c0b (patch) | |
| tree | 2aab051ba193802defa8d668a13adedd721e4a61 /src | |
| parent | bfd87315954eab6d1822c38d88cd83b0580bc207 (diff) | |
| download | mailman-be6a91338ad142d19b2d4bf9c81c300dd76e5c0b.tar.gz mailman-be6a91338ad142d19b2d4bf9c81c300dd76e5c0b.tar.zst mailman-be6a91338ad142d19b2d4bf9c81c300dd76e5c0b.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/common.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/common.c b/src/common.c index 2ae5d0620..712bdae8d 100644 --- a/src/common.c +++ b/src/common.c @@ -196,17 +196,20 @@ run_script(const char* script, int argc, char** argv, char** env) newenv[j] = NULL; /* Now put together argv. This will contain first the absolute path - * to the python executable, then the absolute path to the script, - * then any additional args passed in argv above. + * to the Python executable, then the -S option (to speed executable + * start times), then the absolute path to the script, then any + * additional args passed in argv above. */ - newargv = (char**)malloc(sizeof(char*) * (argc + 2)); - newargv[0] = python; - newargv[1] = (char*)malloc(sizeof(char) * ( + newargv = (char**)malloc(sizeof(char*) * (argc + 3)); + j = 0; + newargv[j++] = python; + newargv[j++] = "-S"; + newargv[j] = (char*)malloc(sizeof(char) * ( strlen(scriptdir) + strlen(script) + 1)); - strcpy(newargv[1], scriptdir); - strcat(newargv[1], script); + strcpy(newargv[j], scriptdir); + strcat(newargv[j], script); /* now tack on all the rest of the arguments. we can skip argv's * first two arguments because, for cgi-wrapper there is only argv[0]. @@ -218,10 +221,10 @@ run_script(const char* script, int argc, char** argv, char** env) * * TBD: have to make sure this works with alias-wrapper. */ - for (i = 2; i < argc; i++) - newargv[i] = argv[i]; + for (i=2, j++; i < argc; i++) + newargv[j++] = argv[i]; - newargv[i] = NULL; + newargv[j] = NULL; /* return always means failure */ (void)execve(python, &newargv[0], &newenv[0]); |
