pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ircd-hybrid: Avoid to log spurious errors regarding pidfile



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Thu Jan 31 16:11:31 2019 +0100
Changeset:	6ad020cbdd972cb929e1a369d7cb3385a379698f

Modified Files:
	ircd-hybrid/distinfo
Added Files:
	ircd-hybrid/patches/patch-src_ircd.c

Log Message:
ircd-hybrid: Avoid to log spurious errors regarding pidfile

Properly check for fgets() errors avoiding printing possible
unrelated (non-fgets()) errors (e.g. when the pidfile is empty).

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=6ad020cbdd972cb929e1a369d7cb3385a379698f

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 ircd-hybrid/distinfo                 |  1 +
 ircd-hybrid/patches/patch-src_ircd.c | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diffs:
diff --git a/ircd-hybrid/distinfo b/ircd-hybrid/distinfo
index 1421ea328f..d95a8a6c6f 100644
--- a/ircd-hybrid/distinfo
+++ b/ircd-hybrid/distinfo
@@ -5,3 +5,4 @@ RMD160 (ircd-hybrid-8.2.24.tgz) = a3021dd95927f7d162de95f47944ec15b1aa6614
 SHA512 (ircd-hybrid-8.2.24.tgz) = 48f68bf1fdb50b446387a310ff45d3cdf2a068d7eca97afa1e30c2486f1ae94fdf2af1db28b1627754ad94b3052edfc9d37255082d7bbdc46893518f2bad6b8c
 Size (ircd-hybrid-8.2.24.tgz) = 1210753 bytes
 SHA1 (patch-doc_Makefile.in) = 787cb151da51cd947a384e33ae35c58df1d17e19
+SHA1 (patch-src_ircd.c) = 473c6b04bf2ca6f6800b681f5bb3af4a7eef465a
diff --git a/ircd-hybrid/patches/patch-src_ircd.c b/ircd-hybrid/patches/patch-src_ircd.c
new file mode 100644
index 0000000000..52723db58b
--- /dev/null
+++ b/ircd-hybrid/patches/patch-src_ircd.c
@@ -0,0 +1,21 @@
+$NetBSD$
+
+Properly check for possible fgets(3) errors (otherwise possible
+unrelated errors are logged).
+
+--- src/ircd.c.orig	2018-04-04 22:33:37.000000000 +0000
++++ src/ircd.c
+@@ -265,8 +265,11 @@ check_pidfile(const char *filename)
+   if ((fb = fopen(filename, "r")))
+   {
+     if (!fgets(buf, 20, fb))
+-      ilog(LOG_TYPE_IRCD, "Error reading from pid file %s: %s",
+-           filename, strerror(errno));
++    {
++      if (ferror(fb))
++        ilog(LOG_TYPE_IRCD, "Error reading from pid file %s: %s",
++             filename, strerror(errno));
++    }
+     else
+     {
+       pid_t pid = atoi(buf);


Home | Main Index | Thread Index | Old Index