From owner-cvs-all@FreeBSD.ORG Mon Aug 7 20:12:19 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C0B9E16A4DE; Mon, 7 Aug 2006 20:12:19 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F9BA43D46; Mon, 7 Aug 2006 20:12:19 +0000 (GMT) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k77KCJud059490; Mon, 7 Aug 2006 20:12:19 GMT (envelope-from phk@repoman.freebsd.org) Received: (from phk@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k77KCJX8059489; Mon, 7 Aug 2006 20:12:19 GMT (envelope-from phk) Message-Id: <200608072012.k77KCJX8059489@repoman.freebsd.org> From: Poul-Henning Kamp Date: Mon, 7 Aug 2006 20:12:19 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/libc/gen syslog.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2006 20:12:19 -0000 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