diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-08-17 08:03:57 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-08-17 12:03:03 -0700 |
commit | 717f1d02e1707b18271a83812989e778c6f5cb77 (patch) | |
tree | 31a9b682db5874ea362546e5ebbe23278589331c /bootstrap.conf | |
parent | 72f1751f6075b036e055a39c8abbbddac6c225c7 (diff) | |
download | coreutils-717f1d02e1707b18271a83812989e778c6f5cb77.tar.gz |
sort: file descriptor discipline
Use O_CLOEXEC when creating file descriptors, so that subsidiary
processes do not inherit file descriptors that they do not need.
This is helpful for ‘sort’, as it is a multithreaded program that
forks and execs.
* bootstrap.conf (gnulib_modules): Add mkostemp, open, pipe2.
* src/sort.c (create_temp_file): Open temporary file with O_CLOEXEC.
(stream_open): Open the stream with O_CLOEXEC.
(pipe_fork): Create the pipe with O_CLOEXEC.
(check_output): Open the output file with O_CLOEXEC.
(main): Use xfopen/xfclose to handle --files0-from, so that
O_CLOEXEC is used properly. This is simpler anyway.
* tests/misc/sort-files0-from.pl: Adjust to change in diagnostic
wording.
Diffstat (limited to 'bootstrap.conf')
-rw-r--r-- | bootstrap.conf | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bootstrap.conf b/bootstrap.conf index f8f65f746..53c52f28e 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -171,6 +171,7 @@ gnulib_modules=" mkdir-p mkfifo mknod + mkostemp mkstemp mktime modechange @@ -180,11 +181,13 @@ gnulib_modules=" non-recursive-gnulib-prefix-hack nproc obstack + open parse-datetime pathmax perl physmem pipe-posix + pipe2 posix-shell posixtm posixver |