diff options
author | phk <phk@FreeBSD.org> | 2006-08-07 20:12:18 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2006-08-07 20:12:18 +0000 |
commit | 1c0399f7981f6976690ab2114fcf6915ac0c724c (patch) | |
tree | 849f4dfb7159c505882724fdd6527fb04589a6af /lib/libthr/thread/thr_init.c | |
parent | 1022710a4334295b43213bdf07d57fc95575935f (diff) | |
download | FreeBSD-src-1c0399f7981f6976690ab2114fcf6915ac0c724c.zip FreeBSD-src-1c0399f7981f6976690ab2114fcf6915ac0c724c.tar.gz |
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
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
0 files changed, 0 insertions, 0 deletions