Branch: Tag:

1996-11-20

1996-11-20 09:33:05 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

pid-loggning

Rev: server/etc/include/roxen.pre.pike:1.3

114:    exit(0);   }    + private static int perror_last_was_newline=1; +  + void perror(string format,mixed ... args) + { +  string s; +  int lwn; +  s=((args==({}))?format:sprintf(format,@args)); +  if (s=="") return; +  if ( (lwn = s[-1]=="\n") ) +  s=s[0..strlen(s)-2]; +  werror((perror_last_was_newline?getpid()+": ":"") +  +replace(s,"\n","\n"+getpid()+": ") +  +(lwn?"\n":"")); +  perror_last_was_newline=lwn; + } +    void create()   {    add_constant("spawne",spawne); -  add_constant("perror",werror); +  add_constant("perror",perror);    add_constant("popen",popen);   }