summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2002-06-21 18:49:11 +0000
committerRyan Bloom <rbb@apache.org>2002-06-21 18:49:11 +0000
commit02be9eb322db1bd086fd36776589706832c92072 (patch)
tree10aa12c28edb698991f48290c7e760666fed85bd /support
parentb61237dec0997203185c94534a61ae07a81ea6f7 (diff)
downloadhttpd-02be9eb322db1bd086fd36776589706832c92072.tar.gz
Add a timeout option to wintty. This allows the user to specify a number
of seconds to wait after the program terminates before closing the window. Previously, the windows would remain open indefinately. This option is not currently being used by Apache. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95836 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support')
-rw-r--r--support/win32/wintty.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/support/win32/wintty.c b/support/win32/wintty.c
index 638ac5a371..47b0be485b 100644
--- a/support/win32/wintty.c
+++ b/support/win32/wintty.c
@@ -83,6 +83,7 @@ const char *options =
"\t-u{nprocessed} or -p{rocessed} input\n"
"\t-n{owrap} or -w{rap} output lines\n"
"\t-f{ormatted} or -r{aw} output lines\n"
+"\t-O{output} [number of seconds]\n"
"\t-v{erbose} error reporting (for debugging)\n"
"\t-? for this message\n\n";
@@ -120,6 +121,7 @@ int main(int argc, char** argv)
DWORD newoutmode = 0, notoutmode = 0;
DWORD tid;
DWORD len;
+ DWORD timeout = INFINITE;
BOOL isservice = FALSE;
char *arg0 = argv[0];
@@ -147,6 +149,16 @@ int main(int argc, char** argv)
notoutmode |= ENABLE_PROCESSED_OUTPUT; break;
case 'f':
newoutmode |= ENABLE_PROCESSED_OUTPUT; break;
+ case 'o':
+ if (*(argv + 1) && *(argv + 1)[0] != '-') {
+ *(++argv);
+ timeout = atoi(*argv) / 1000;
+ --argc;
+ }
+ else {
+ timeout = 0;
+ }
+ break;
case 'v':
verbose = TRUE;
break;
@@ -358,7 +370,7 @@ int main(int argc, char** argv)
}
}
- WaitForSingleObject(thread, INFINITE);
+ WaitForSingleObject(thread, timeout);
FreeConsole();
if (isservice) {
if (!SetProcessWindowStation(hsavewinsta)) {