[master] 7f457cf Only react on kill(2) if process doesn't exist.

Poul-Henning Kamp phk at FreeBSD.org
Fri Sep 8 10:00:08 UTC 2017


commit 7f457cf016b1f44329e6272bded76888ae2a5613
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Sep 8 09:54:13 2017 +0000

    Only react on kill(2) if process doesn't exist.

diff --git a/lib/libvarnishapi/vsm.c b/lib/libvarnishapi/vsm.c
index 50e1805..ccb0dfb 100644
--- a/lib/libvarnishapi/vsm.c
+++ b/lib/libvarnishapi/vsm.c
@@ -377,7 +377,7 @@ vsm_refresh_set2(struct vsm *vd, struct vsm_set *vs, struct vsb *vsb)
 	 * XXX: be kill(pid,0)'ed for more rapid abandonment detection.
 	 */
 	i = sscanf(VSB_data(vsb), "# %ju %ju\n%n", &id1, &id2, &ac);
-	if (i != 2 || kill(id1, 0)) {
+	if (i != 2 || (kill(id1, 0) && errno == ESRCH)) {
 		retval |= VSM_MGT_RESTARTED | VSM_MGT_CHANGED;
 		return (retval);
 	}


More information about the varnish-commit mailing list