Commit 68abc38a authored by 's avatar

*** empty log message ***

parent 3381c75c
...@@ -39,11 +39,14 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN ...@@ -39,11 +39,14 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- 2.0a5 29 October 1998
- (brian) fixed arg type mismatch for semctl
- 2.0a4 10 August 1998 - 2.0a4 10 August 1998
-fixed Win32 local socket host address issues - (jeff) fixed Win32 local socket host address issues
- 2.0a4 8 August 1998 - 2.0a4 8 August 1998
-added Win32 support - (jeff) added Win32 support
*/ */
#include "pcgi.h" #include "pcgi.h"
...@@ -52,7 +55,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ...@@ -52,7 +55,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
char spewbuf[1024]; /* yes, it's a global, but only for debugging */ char spewbuf[1024]; /* yes, it's a global, but only for debugging */
#endif #endif
static char _id_[]="$Id: pcgi-wrapper.c,v 1.1 1998/10/19 20:04:37 brian Exp $"; static char _id_[]="$Id: pcgi-wrapper.c,v 1.2 1998/10/29 15:37:20 brian Exp $";
/* Globals, OR: "I'll know I'll hate myself in the morning" */ /* Globals, OR: "I'll know I'll hate myself in the morning" */
extern char **environ; extern char **environ;
...@@ -60,6 +63,7 @@ int CloseFileDescriptors = 0; ...@@ -60,6 +63,7 @@ int CloseFileDescriptors = 0;
#if UNIX #if UNIX
int g_lock = 0; int g_lock = 0;
union semun sem_idx;
#endif #endif
#if PCGI_WRAPPER_MAIN #if PCGI_WRAPPER_MAIN
...@@ -81,6 +85,11 @@ int main(int argc, char *argv[]) ...@@ -81,6 +85,11 @@ int main(int argc, char *argv[])
#ifdef CLOSE_FDS #ifdef CLOSE_FDS
CloseFileDescriptors = 1; CloseFileDescriptors = 1;
#endif #endif
#ifdef UNIX
sem_idx.val=0;
#endif
/* /*
// Initialize resource info // Initialize resource info
*/ */
...@@ -704,7 +713,7 @@ void cleanup() ...@@ -704,7 +713,7 @@ void cleanup()
#ifdef UNIX #ifdef UNIX
if (g_lock > 0) if (g_lock > 0)
{ {
semctl(g_lock, 1, IPC_RMID, (union semun)sem_idx); semctl(g_lock, 1, IPC_RMID, sem_idx);
} }
#endif #endif
} }
...@@ -781,7 +790,7 @@ int pcgiStartProc(pcgiResource *r) ...@@ -781,7 +790,7 @@ int pcgiStartProc(pcgiResource *r)
init will inherit the grandchild (so it won't die) */ init will inherit the grandchild (so it won't die) */
if ((pid = fork()) < 0) if ((pid = fork()) < 0)
{ {
semctl(r->lock, 1, IPC_RMID, (union semun)0); semctl(r->lock, 1, IPC_RMID, sem_idx);
return(-1); return(-1);
} }
else if (pid == 0) else if (pid == 0)
...@@ -822,14 +831,14 @@ int pcgiStartProc(pcgiResource *r) ...@@ -822,14 +831,14 @@ int pcgiStartProc(pcgiResource *r)
/* Wait for the first child to finish */ /* Wait for the first child to finish */
if (waitpid(pid, NULL, 0) < 0) if (waitpid(pid, NULL, 0) < 0)
{ semctl(r->lock, 1, IPC_RMID, (union semun)0); { semctl(r->lock, 1, IPC_RMID, sem_idx);
return(-1); return(-1);
} }
/* /*
// Release restart lock! // Release restart lock!
*/ */
semctl(r->lock, 1, IPC_RMID, (union semun)0); semctl(r->lock, 1, IPC_RMID, sem_idx);
/* /*
// Reset signal handlers // Reset signal handlers
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment