summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2002-01-31 02:03:57 +0000
committerwtc%netscape.com <devnull@localhost>2002-01-31 02:03:57 +0000
commit92800ab3ceeca7304fa6cec538f7341c525408ff (patch)
tree54de7b323c59a7bbfb0093248c1d14aa2f0e1fd3
parent630a1977725e6c92258113b6f3f63614770654b8 (diff)
downloadnss-hg-92800ab3ceeca7304fa6cec538f7341c525408ff.tar.gz
Bugzilla bug 119340: backed out the fix. We are still seeing the
"selfserv process not detectable" errors on Linux and I don't have time to get to the bottom of it. Modified files: cmd/selfserv/selfserv.c tests/common/init.sh tests/ssl/ssl.sh
-rw-r--r--security/nss/cmd/selfserv/selfserv.c31
-rwxr-xr-xsecurity/nss/tests/ssl/ssl.sh20
2 files changed, 3 insertions, 48 deletions
diff --git a/security/nss/cmd/selfserv/selfserv.c b/security/nss/cmd/selfserv/selfserv.c
index 818b60f4e..185aa92a5 100644
--- a/security/nss/cmd/selfserv/selfserv.c
+++ b/security/nss/cmd/selfserv/selfserv.c
@@ -141,15 +141,6 @@ static int requestCert;
static int verbose;
static SECItem bigBuf;
-static const char *pidFile;
-/*
- * On Linux, the first thread we create writes its pid to a file.
- * (See bug 119340 for why we do this.)
- */
-#ifdef LINUX
-static PRInt32 threadIndex;
-#endif
-
static PRThread * acceptorThread;
static PRLogModuleInfo *lm;
@@ -429,27 +420,6 @@ thread_wrapper(void * arg)
{
perThread * slot = (perThread *)arg;
-#ifdef LINUX /* bug 119403 */
- if (pidFile && PR_AtomicIncrement(&threadIndex) == 1) {
- char *pidFile2;
- FILE *tmpfile;
-
- pidFile2 = PORT_Alloc(PORT_Strlen(pidFile) + 3);
- if (pidFile2 == NULL) {
- return; /* failed */
- }
- strcpy(pidFile2, pidFile);
- strcat(pidFile2, ".2");
- tmpfile=fopen(pidFile2,"w+");
-
- if (tmpfile) {
- fprintf(tmpfile,"%d",getpid());
- fclose(tmpfile);
- }
- PORT_Free(pidFile2);
- }
-#endif /* LINUX */
-
slot->rv = (* slot->startFunc)(slot->a, slot->b, slot->c);
/* notify the thread exit handler. */
@@ -1414,6 +1384,7 @@ main(int argc, char **argv)
char * cipherString= NULL;
const char * dir = ".";
char * passwd = NULL;
+ const char * pidFile = NULL;
char * tmp;
char * envString;
PRFileDesc * listen_sock;
diff --git a/security/nss/tests/ssl/ssl.sh b/security/nss/tests/ssl/ssl.sh
index ed8e34e14..06b672fdf 100755
--- a/security/nss/tests/ssl/ssl.sh
+++ b/security/nss/tests/ssl/ssl.sh
@@ -141,29 +141,13 @@ wait_for_selfserv()
########################################################################
kill_selfserv()
{
- # Bug 119340: This is an inelegant but more reliable way to ensure
- # that a multithreaded process on Linux has been completely killed.
- # Recall that each thread is a process on Linux. Instead of killing
- # the primary thread, we kill the first thread created by selfserv and
- # let the thread manager take care of terminating the other threads in
- # selfserv. The assumption we rely on is that the primary thread is
- # the last one to go because it's the parent of the thread manager.
- #
- # On Linux, the first thread created by selfserv writes its pid to the
- # {SERVERPID}.2 file.
- if [ "${OS_ARCH}" = "Linux" ]; then
- ${KILL} `cat ${SERVERPID}.2`
- else
- ${KILL} `cat ${SERVERPID}`
- fi
+ ${KILL} `cat ${SERVERPID}`
wait `cat ${SERVERPID}`
if [ ${fileout} -eq 1 ]; then
cat ${SERVEROUTFILE}
fi
+ ${SLEEP} #FIXME linux waits 30 seconds - find a shorter way (sockets free)
rm ${SERVERPID}
- if [ "${OS_ARCH}" = "Linux" ]; then
- rm ${SERVERPID}.2
- fi
}
########################### start_selfserv #############################