[CF-Devel] 32k patch to propose

Benjamin `Quisar' Lerman quisar at quisar.ambre.net
Tue Mar 6 16:28:58 CST 2001


 Mark Wedel a écrit : 
>
     
       Agree.  But chances are, if your running and hoping to debug (and putting
     
     >
     
      fprintf(stderr,)), you are not going to run in daemon mode.
     
     
 So ? In this case my patch doesn't change anything.

>
     
       In fact, realistically, I don't know how many people run in daemon mode -
     
     >
     
      whenever I do it, I use the crossloop scripts.
     
     
 Well I do. And if you don't run in daemon mode, the -log doesn't have
any effect. The logfile is open in the BecomeDaemon function.

>
     
       Your trying to read intent into others code.  Perhaps they really want
     
     >
     
       that output to go to stderr.  Or maybe its a bug its going to stderr -
     
     >
     
       can't say for
     
     
 Well, if they really want output to go to stderr, they completly forgot
the Daemon mode, stderr is closed when you go to Daemon mode, so the logs
are lost. And if is is just debug intended to only one develloper, I
don't see why it has been checked in in the first place.

>
     
       But even given that, if you are running in daemon mode and also want
     
     >
     
       the stderr stuff, it is easy enough to modify BecomeDaemon to have
     
     >
     
       stderr point to the logfile at that point.
     
     
 Well, that's what I did. That mean reopen stderr as a file. And that's
the reason of my patch. Then it seems that it was not useless to have to
file descriptor pointing to the same thing, and that was why I remove the
file descriptor logfile and put all to stderr, because I thought that it
mades all the code to be more consistant.

>
     
       If not running in daemon mode:
     
     >
     
      logfile goes where you expect it (stderr by default, or wherever -log points)
     
     >
     
      stderr goes to stderr, which is what you espect.
     
     
 No it don't. -log doesn't work when you are not running in daemon mode.
So all go to stderr, and my patch didn't changed anything. I think I
begin to understand your objections, but -log doesn't work outside the
daemon mode, so my pacth doesn't changed anything to the comportment of
the server outside daemon mode.

>
     
       If running in daemon mode:
     
     >
     
      logfile goes where you expect it (to some logfile).
     
     >
     
      stderr (which would otherwise be lost) can go to the logfile
     
     
 No stderr cannot go to logfile, unless you reopen it, because stderr is
closed in the BecomeDaemon function.

-- 
 Benjamin `Quisar' Lerman
 
     
     quisar at quisar.ambre.net
     
     
     http://www.ambre.net/quisar
     
     
 "Si les yeux pouvaient tuer et enfanter, les rues seraient pleines de cadavres
et de femmes grosses." Valery

    
    


More information about the crossfire mailing list