Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Feb 2011 14:06:37 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218373 - head/sbin/hastd
Message-ID:  <201102061406.p16E6b5P067259@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sun Feb  6 14:06:37 2011
New Revision: 218373
URL: http://svn.freebsd.org/changeset/base/218373

Log:
  Open syslog when logging sysconf(3) failure.
  
  Reported by:	Mikolaj Golub <to.my.trociny@gmail.com>
  MFC after:	1 week

Modified:
  head/sbin/hastd/hastd.c

Modified: head/sbin/hastd/hastd.c
==============================================================================
--- head/sbin/hastd/hastd.c	Sun Feb  6 13:59:03 2011	(r218372)
+++ head/sbin/hastd/hastd.c	Sun Feb  6 14:06:37 2011	(r218373)
@@ -168,7 +168,11 @@ descriptors_assert(const struct hast_res
 
 	maxfd = sysconf(_SC_OPEN_MAX);
 	if (maxfd < 0) {
+		pjdlog_init(pjdlogmode);
+		pjdlog_prefix_set("[%s] (%s) ", res->hr_name,
+		    role2str(res->hr_role));
 		pjdlog_errno(LOG_WARNING, "sysconf(_SC_OPEN_MAX) failed");
+		pjdlog_fini();
 		maxfd = 16384;
 	}
 	for (fd = 0; fd <= maxfd; fd++) {



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