Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Aug 2006 20:12:19 +0000 (UTC)
From:      Poul-Henning Kamp <phk@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/lib/libc/gen syslog.c
Message-ID:  <200608072012.k77KCJX8059489@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608072012.k77KCJX8059489>