svn commit: r218373 - head/sbin/hastd

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Feb 6 14:06:38 UTC 2011


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 at 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++) {


More information about the svn-src-all mailing list