summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--text-utils/more.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/text-utils/more.c b/text-utils/more.c
index 2b4fceb92..72f2832a7 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -47,6 +47,7 @@
#include <ctype.h>
#include <signal.h>
#include <errno.h>
+#include <fcntl.h>
#include <termios.h>
#include <setjmp.h>
#include <sys/ioctl.h>
@@ -478,6 +479,7 @@ checkf (fs, clearfirst)
}
if (magic(f, fs))
return((FILE *)NULL);
+ fcntl(fileno(f), F_SETFD, FD_CLOEXEC );
c = Getc(f);
*clearfirst = (c == '\f');
Ungetc (c, f);