manoj 99/02/04 12:31:27
Modified: pthreads/src/include multithread.h pthreads/src/modules/standard mod_mime_magic.c pthreads/src/os/unix multithread.c os-inline.c os.h pthreads/src/os/win32 os.h Log: Minor cleanup of spawnvp operations. No functionality change. Revision Changes Path 1.3 +0 -1 apache-apr/pthreads/src/include/multithread.h Index: multithread.h =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/include/multithread.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -u -r1.2 -r1.3 --- multithread.h 1999/01/27 16:15:46 1.2 +++ multithread.h 1999/02/04 20:31:19 1.3 @@ -55,7 +55,6 @@ API_EXPORT(int) ap_acquire_mutex(mutex *mutex_id); API_EXPORT(int) ap_release_mutex(mutex *mutex_id); API_EXPORT(void) ap_destroy_mutex(mutex *mutex_id); -API_EXPORT(int) ap_spawnvp(const char *, char *const []); #endif /* ndef MULTITHREAD */ #ifdef __cplusplus 1.4 +1 -5 apache-apr/pthreads/src/modules/standard/mod_mime_magic.c Index: mod_mime_magic.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_mime_magic.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -u -r1.3 -r1.4 --- mod_mime_magic.c 1999/02/03 07:49:02 1.3 +++ mod_mime_magic.c 1999/02/04 20:31:20 1.4 @@ -2145,12 +2145,8 @@ close(STDERR_FILENO); } -#if defined(WIN32) - child_pid = spawnvp(compr[parm->method].argv[0], + child_pid = ap_spawnvp(compr[parm->method].argv[0], compr[parm->method].argv); -#else - child_pid = ap_spawnvp(compr[parm->method].argv[0], compr[parm->method].argv); -#endif if (child_pid == -1) ap_log_rerror(APLOG_MARK, APLOG_ERR, parm->r, MODNAME ": could not execute `%s'.", 1.4 +0 -13 apache-apr/pthreads/src/os/unix/multithread.c Index: multithread.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/os/unix/multithread.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -u -r1.3 -r1.4 --- multithread.c 1999/02/03 17:50:14 1.3 +++ multithread.c 1999/02/04 20:31:22 1.4 @@ -30,16 +30,3 @@ pthread_mutex_destroy((pthread_mutex_t *) mutex_id); } -API_EXPORT(int) ap_spawnvp(const char *file, char *const argv[]) -{ - int pid; - - if ((pid = fork()) == -1) { - return pid; - } else if (pid == 0) { - if (execvp(file, argv) == -1) - return -1; - } else - return pid; -} - 1.2 +14 -0 apache-apr/pthreads/src/os/unix/os-inline.c Index: os-inline.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/os/unix/os-inline.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- os-inline.c 1999/01/21 23:08:40 1.1 +++ os-inline.c 1999/02/04 20:31:23 1.2 @@ -29,3 +29,17 @@ { return file[0] == '/'; } + +INLINE int ap_spawnvp(const char *file, char *const argv[]) +{ + int pid; + + if ((pid = fork()) == -1) { + return pid; + } else if (pid == 0) { + if (execvp(file, argv) == -1) + return -1; + } else + return pid; +} + 1.2 +6 -0 apache-apr/pthreads/src/os/unix/os.h Index: os.h =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/os/unix/os.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- os.h 1999/01/21 23:08:40 1.1 +++ os.h 1999/02/04 20:31:23 1.2 @@ -94,6 +94,12 @@ #endif /* + * spawn = fork + exec on unix + */ + +extern int ap_spawnvp(const char *, char *const []); + +/* * Do not use native AIX DSO support */ #ifdef AIX 1.2 +3 -0 apache-apr/pthreads/src/os/win32/os.h Index: os.h =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/os/win32/os.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -u -r1.1 -r1.2 --- os.h 1999/01/21 23:08:41 1.1 +++ os.h 1999/02/04 20:31:25 1.2 @@ -13,6 +13,9 @@ /* char *crypt(const char *pw, const char *salt); */ #define crypt(buf,salt) (buf) +/* Use the Windows built-in spawnvp */ +#define ap_spawnvp(file, argv) (spawnvp(file, argv)) + /* Although DIR_TYPE is dirent (see nt/readdir.h) we need direct.h for chdir() */ #include <direct.h>