shane Sun Oct 13 01:55:03 2002 EDT Modified files: /php4/sapi/cgi/libfcgi os_win32.c Log: fix invalid handle issue that shutdown php fastcgi prematurly fix checking os name for impersonation Index: php4/sapi/cgi/libfcgi/os_win32.c diff -u php4/sapi/cgi/libfcgi/os_win32.c:1.4 php4/sapi/cgi/libfcgi/os_win32.c:1.5 --- php4/sapi/cgi/libfcgi/os_win32.c:1.4 Sun Mar 17 23:48:34 2002 +++ php4/sapi/cgi/libfcgi/os_win32.c Sun Oct 13 01:55:03 2002 @@ -17,7 +17,7 @@ * significantly more enjoyable.) */ #ifndef lint -static const char rcsid[] = "$Id: os_win32.c,v 1.4 2002/03/18 04:48:34 shane Exp $"; +static const char rcsid[] = "$Id: os_win32.c,v 1.5 2002/10/13 05:55:03 shane Exp $"; #endif /* not lint */ #define WIN32_LEAN_AND_MEAN @@ -295,7 +295,7 @@ { char *os_name = NULL; os_name = getenv("OS"); - if (stricmp(os_name, "Windows_NT") == 0) { + if (os_name && stricmp(os_name, "Windows_NT") == 0) { bImpersonate = TRUE; return 1; } @@ -524,7 +524,6 @@ stdioHandles[STDOUT_FILENO] = GetStdHandle(STD_OUTPUT_HANDLE); if(!SetHandleInformation(stdioHandles[STDOUT_FILENO], HANDLE_FLAG_INHERIT, FALSE)) { - DebugBreak(); //exit(99); return -1; } @@ -543,7 +542,6 @@ stdioHandles[STDERR_FILENO] = GetStdHandle(STD_ERROR_HANDLE); if(!SetHandleInformation(stdioHandles[STDERR_FILENO], HANDLE_FLAG_INHERIT, FALSE)) { - DebugBreak(); //exit(99); return -1; } @@ -788,11 +786,6 @@ HANDLE mutex = INVALID_HANDLE_VALUE; char mutexEnvString[100]; - if (mutex == NULL) - { - return -2; - } - if (bCreateMutex) { mutex = CreateMutex(NULL, FALSE, NULL); if (! SetHandleInformation(mutex, HANDLE_FLAG_INHERIT, TRUE)) @@ -983,7 +976,7 @@ if (p) { int len = p - bindPath + 1; - host = malloc(len); + host = (char *)malloc(len); if (!host) { fprintf(stderr, "Unable to allocate memory\n"); return -1; @@ -1543,8 +1536,12 @@ /* * CloseHandle returns: TRUE success, 0 failure */ + /* + XXX don't close here, fcgi apps fail if we do so + need to examine resource leaks if any might exist if (CloseHandle(fdTable[fd].fid.fileHandle) == FALSE) ret = -1; + */ break; case FD_SOCKET_SYNC: case FD_SOCKET_ASYNC:
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php