httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TOKI...@aol.com
Subject Re: A solution to the Win32 console problem
Date Sun, 18 Jun 2000 15:19:52 GMT

In a message dated 00-06-18 11:42:21 EDT, William Rowe writes...

>  > I think, also, that many will choose to run 2.0 as a non-service 
>  > so the 'no exit' /K flag problem may carry over into 2.0.
>  
>  No, again... run it as a console, under a win32 wrapper, whatever you
>  wish to do, but never friggin run the batch file that way.  It's for
>  *SHORTCUTS ONLY*.
>
>  Ya know what, if they are going to be dinking with watchdogs, rewriting
>  shortcuts, and playing obtuse games, then they will get a 'RTFM' message
>  back on the newsgroup.  Otherwise, if they are learning, this will
>  protect them till they know enough to be dangerous :)
>  
>  > Most of the PR reports in this area are always the 'Hey I just
>  > ran your windows program and I don't get a window and some
>  > black box flashes on my screen what's wrong with your software'
>  > kinda folk.
>  
>  And this solves it (80/20)
> ...
>  And see above, we will never please everybody, so how do we chop
>  out 80% of the bug reports in one whack without hurting any one
>  interest too terribly?

By using /K and be done with it and put an RTFM mail message on
function key 12 at Ken Coar's machine.

Go for it. 

It's really a wonder it wasn't there in the very first Win32 version
since tons of PR's were generated that were simply Apache trying to
say 'ServerRoot not defined' or something equally simple and no one was 
getting a chance to see it.

>  > That's why I always hate to submit macros to people.
>  > Some people love them, some people cop an attitude about them.
>  > 
>  > I don't know what is 'dirty' about it... looks pretty simple to me.
>  
>  It's quite simple, but will be instantiated about two dozen times in the
>  code... I don't think it would be a problem to call out to a function
>  WRAPPED in a macro, such as 
>  
>  #define exit(x) ap_pause_for_error_and_exit(x)
>  
>  which is all I'm suggesting, the code looks (on a quick glance) just
>  fine for what we want to do (with the caviat that it will interact
>  with the console_control_handler()).

If you go for it don't miss the chance to just do this...

#define exit(x) ap_pause_for_error_and_exit( __FILE__, __LINE__, x )

It will pay off in the long run to KNOW where the exit() is taking place.

>  > BTW: The {} block is most assuredly NOT required. Maybe for
>  > gcc but never for MSVC or Borland. The macro works perfectly 
>  > fine at all times just as it is. I have never found an occasion in
>  > the Apache code where it doesn't work.
>  
>  I'll break it...
>  
>    if (retval != ERROR_SUCCESS)
>        exit(1);
>    do_something_useful();
>  
>  In your simple example... expanded to
>  
>    if (retval != ERROR_SUCCESS)
>        printf("Press any key to perform exit(%d)...\n", 1 ); 
>    while(!kbhit()); 
>    exit(code);
>    do_something_useful();
>  
>  Code indented for clarity.  Now if we already protect exit() blocks,
>  that's well and good, but as a vanilla macro, it's a bit dangerous.

It's not a vanilla macro. Never said it was. It's a very SPECIAL
macro and your example does NOT break it. 

It's NEVER going to hit 'do_something_useful()'.

Wherever the code block is called it will NEVER return to hit
anything that might be after the 'exit()'.

If it wasn't an EXIT routine then, of course, the use of braces prevents
errors down in the code... but it works fine 'as-is'.

Yours...

Kevin Kiley, CTO, Remote Communications, Inc.
http://www.RemoteCommunications.com
http://www.rctp.com - Online Internet Content Compression Server


Mime
View raw message