Programs which close some inherited file descriptors and are run under
valgrind with -q and --track-fds=yes would still show the FILE
DESCRIPTORS banner even if there were no non-inherited file
descriptors still open.
Fix this by not counting already closed inherited file descriptors.
Add a simple testcase to show /usr/bin/cat /dev/null doesn't produce
any output running under valgrind -q --track-fds=yes.
https://bugs.kde.org/show_bug.cgi?id=504177
503677 duplicated-cond compiler warning in dis_RV64M
503817 s390x: fix 'ordered comparison of pointer with integer zero' compiler warnings
503914 mount syscall param filesystemtype may be NULL
+504177 FILE DESCRIPTORS banner shows when closing some inherited fds
To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
int inherited = 0;
for (i = allocated_fds; i; i = i->next) {
- if (i->where == NULL)
+ if (i->where == NULL && !i->fd_closed)
inherited++;
}
execve.vgtest execve.stdout.exp execve.stderr.exp \
faultstatus.vgtest faultstatus.stderr.exp faultstatus.stderr.exp-s390x \
fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \
+ fdleak_cat.vgtest fdleak_cat.stderr.exp \
fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \
fdleak_cmsg_xml.stderr.exp-ppc64le \
fdleak_cmsg_xml.stderr.exp fdleak_cmsg_xml.vgtest \
--- /dev/null
+prog: /usr/bin/cat
+vgopts: -q --track-fds=yes
+args: /dev/null