* lib/save-cwd.c (save_cwd): set the close-on-exec flag for the
saved file descriptor.
* modules/save-cwd (Depends-on): Depend on cloexec.
+2010-03-28 James Youngman <jay@gnu.org>
+
+ save-cwd: don't leak a file descriptor when the caller execs.
+ * lib/save-cwd.c (save_cwd): set the close-on-exec flag for the
+ saved file descriptor.
+ * modules/save-cwd (Depends-on): Depend on cloexec.
+
2010-03-29 Bruno Haible <bruno@clisp.org>
Remove vestiges of fts-lgpl module.
#include "chdir-long.h"
#include "unistd--.h"
#include "xgetcwd.h"
+#include "cloexec.h"
#if GNULIB_FCNTL_SAFER
# include "fcntl--.h"
return cwd->name ? 0 : -1;
}
+ set_cloexec_flag (cwd->desc, true);
return 0;
}
Depends-on:
chdir-long
+cloexec
stdbool
unistd-safer
xgetcwd