From 648e8f1438e2c39e20ef6b4d6f6891246237abe5 Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Wed, 16 Apr 2003 18:04:58 +0000 Subject: # Changed it again to this time use the TINYPROXY_DEBUG environment variable to determine whether to wait for a connection from GDB. --- src/child.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/child.c b/src/child.c index 424933b..cc0a16b 100644 --- a/src/child.c +++ b/src/child.c @@ -1,4 +1,4 @@ -/* $Id: child.c,v 1.9 2003-04-16 16:39:23 rjkaes Exp $ +/* $Id: child.c,v 1.10 2003-04-16 18:04:58 rjkaes Exp $ * * Handles the creation/destruction of the various children required for * processing incoming connections. @@ -179,12 +179,18 @@ child_main(struct child_s* ptr) connfd = accept(listenfd, cliaddr, &clilen); -/* Enable this when you want to use GDB */ -#if 0 - /* Pause for 10 seconds to allow us to connect debugger */ - fprintf(stderr, "Process has accepted connection: %u\n", ptr->tid); - sleep(10); - fprintf(stderr, "Continuing process: %u\n", ptr->tid); +#ifndef NDEBUG + /* + * Enable the TINYPROXY_DEBUG environment variable if you + * want to use the GDB debugger. + */ + if (getenv("TINYPROXY_DEBUG")) { + /* Pause for 10 seconds to allow us to connect debugger */ + fprintf(stderr, + "Process has accepted connection: %u\n", ptr->tid); + sleep(10); + fprintf(stderr, "Continuing process: %u\n", ptr->tid); + } #endif /* -- cgit v1.2.3