You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2002/06/21 20:49:11 UTC

cvs commit: httpd-2.0/support/win32 wintty.c

rbb         2002/06/21 11:49:11

  Modified:    support/win32 wintty.c
  Log:
  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.
  
  Revision  Changes    Path
  1.11      +13 -1     httpd-2.0/support/win32/wintty.c
  
  Index: wintty.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/support/win32/wintty.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- wintty.c	30 May 2002 04:47:03 -0000	1.10
  +++ wintty.c	21 Jun 2002 18:49:11 -0000	1.11
  @@ -83,6 +83,7 @@
   "\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 @@
       DWORD newoutmode = 0, notoutmode = 0;
       DWORD tid;
       DWORD len;
  +    DWORD timeout = INFINITE;
       BOOL isservice = FALSE;
       char *arg0 = argv[0];
   
  @@ -147,6 +149,16 @@
                       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 @@
           }
       }
   
  -    WaitForSingleObject(thread, INFINITE);
  +    WaitForSingleObject(thread, timeout);
       FreeConsole();
       if (isservice) {
           if (!SetProcessWindowStation(hsavewinsta)) {