cvs commit: src/lib/libc/gen syslog.c

Poul-Henning Kamp phk at FreeBSD.org
Mon Aug 7 20:12:19 UTC 2006


phk         2006-08-07 20:12:18 UTC

  FreeBSD src repository

  Modified files:
    lib/libc/gen         syslog.c 
  Log:
  Return length from fwopen() file callback instead of zero.
  
  The symptom is that syslog() fails to log anything but the "ident"
  string if LOG_PERROR is specified to openlog(3) and the extensible
  printf is in action.
  
  For unclear, likely quaint historical reasons, syslog uses fwopen()
  on a stack buffer, rather than using the more straightforward
  and faster snprintf().
  
  Along the way, fflush(3) is called, and since the callback writer
  function returns zero instead of the length "written", __SERR
  naturally gets set on the filedescriptor.
  
  The extensible printf, in difference from the normal printf refuses
  to output anything to an __SERR marked filedescriptor, and thus
  the actual syslog message is supressed.
  
  MFC:    after 2 weeks
  
  Revision  Changes    Path
  1.38      +1 -1      src/lib/libc/gen/syslog.c


More information about the cvs-src mailing list