diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-04-16 18:04:58 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-04-16 18:04:58 +0000 |
commit | 648e8f1438e2c39e20ef6b4d6f6891246237abe5 (patch) | |
tree | 43496f46e3acefc57969c0b32f01c89bae1f534c /src | |
parent | 4a942bc59a515579251a3155d21c4925c1dfc6ea (diff) | |
download | tinyproxy-648e8f1438e2c39e20ef6b4d6f6891246237abe5.tar.gz tinyproxy-648e8f1438e2c39e20ef6b4d6f6891246237abe5.zip |
# Changed it again to this time use the TINYPROXY_DEBUG environment
variable to determine whether to wait for a connection from GDB.
Diffstat (limited to 'src')
-rw-r--r-- | src/child.c | 20 |
1 files changed, 13 insertions, 7 deletions
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 /* |