chg: show debug message for each fd to be closed stable
authorYuya Nishihara <yuya@tcha.org>
Tue, 03 Nov 2020 11:12:25 +0900
branchstable
changeset 45769 731ea8fa1f11
parent 45768 41aaf960dc00
child 45770 9534de20358f
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.
contrib/chg/chg.c
--- a/contrib/chg/chg.c	Tue Nov 03 11:06:15 2020 +0900
+++ b/contrib/chg/chg.c	Tue Nov 03 11:12:25 2020 +0900
@@ -289,6 +289,7 @@
 				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 "