Patchwork [2,of,4,STABLE] chg: show debug message for each fd to be closed

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 3, 2020, 2:54 a.m.
Message ID <731ea8fa1f110b285682.1604372086@mimosa>
Download mbox | patch
Permalink /patch/47540/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 3, 2020, 2:54 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1604369545 -32400
#      Tue Nov 03 11:12:25 2020 +0900
# Branch stable
# Node ID 731ea8fa1f110b2856826db5ed78fc1178dc1306
# Parent  41aaf960dc00d85712d412a4aba81e742aa7b69e
chg: show debug message for each fd to be closed

It helps debugging. The number of file descriptors should be small in most
cases, so the console output wouldn't get bloated even with CHG_DEBUG=1.

Patch

diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c
--- a/contrib/chg/chg.c
+++ b/contrib/chg/chg.c
@@ -289,6 +289,7 @@  static void execcmdserver(const struct c
 				continue;
 			}
 			if (fd_value > STDERR_FILENO) {
+				debugmsg("closing fd %ld", fd_value);
 				int res = close(fd_value);
 				if (res) {
 					debugmsg("tried to close fd %ld: %d "