summaryrefslogtreecommitdiff
path: root/lib/fdleak.h
diff options
context:
space:
mode:
authorPavel Modilaynen <pavelmn@axis.com>2019-04-26 09:12:18 +0200
committerJames Youngman <jay@gnu.org>2019-05-05 18:10:40 +0100
commit5699fb78d44a9f5064f98459178ee8e7fa159645 (patch)
tree2423ac062693e107e7ac871eb16ad31ae95cecaa /lib/fdleak.h
parent755a22b9820d554d1dd8b82fd3c3ad1d3d688c81 (diff)
downloadfindutils-5699fb78d44a9f5064f98459178ee8e7fa159645.tar.gz
xargs: use GNU_FINDUTILS_FD_LEAK_CHECK as for find
Utilize GNU_FINDUTILS_FD_LEAK_CHECK environment variable to enable/disable fd leak check for xargs the same way as for find. * find/defs.h: Remove prototype for fd_leak_check_is_enabled(). * find/util.c: Remove implementation of fd_leak_check_is_enabled(). * lib/fdleak.c: Add implementation of fd_leak_check_is_enabled(). * lib/fdleak.h: Add prototype for fd_leak_check_is_enabled(). * xargs/testsuite/config/unix.exp: Enable GNU_FINDUTILS_FD_LEAK_CHECK for all tests. * xargs/xargs.c: Execute complain_about_leaky_fds when fd_leak_check_is_enabled returns true. * NEWS (Improvements): Document support of GNU_FINDUTILS_FD_LEAK_CHECK by xargs. Copyright-paperwork-exempt: Yes
Diffstat (limited to 'lib/fdleak.h')
-rw-r--r--lib/fdleak.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/fdleak.h b/lib/fdleak.h
index a3c8c3a4..2979dc31 100644
--- a/lib/fdleak.h
+++ b/lib/fdleak.h
@@ -17,9 +17,12 @@
#ifndef FDLEAK_H
# define FDLEAK_H
+# include <stdbool.h> /* for bool */
+
void remember_non_cloexec_fds (void);
void forget_non_cloexec_fds (void);
void complain_about_leaky_fds (void);
+bool fd_leak_check_is_enabled (void);
int open_cloexec(const char *path, int flags, ...);