aboutsummaryrefslogtreecommitdiff
path: root/posix/Makefile
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-09-16 17:44:50 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.com>2016-09-28 14:07:35 -0700
commite83be730910c341f2f02ccc207b0586bb04fc21a (patch)
tree6f8ff0de28073a7706be43359fa45fa50ea1b3f3 /posix/Makefile
parent4b4d4056bb154603f36c6f8845757c1012758158 (diff)
downloadglibc-e83be730910c341f2f02ccc207b0586bb04fc21a.zip
glibc-e83be730910c341f2f02ccc207b0586bb04fc21a.tar.gz
glibc-e83be730910c341f2f02ccc207b0586bb04fc21a.tar.bz2
posix: Fix open file action for posix_spawn on Linux
On posix_spawn open file action (issued by posix_spawn_file_actions_addopen) POSIX states that if fildes was already an open file descriptor, it shall be closed before the new file is openedi [1]. This avoid pontential issues when posix_spawn plus addopen action is called with the process already at maximum number of file descriptor opened and also for multiple actions on single-open special paths (like /dev/watchdog). This fixes its behavior on Linux posix_spawn implementation and also adds a tests to check for its behavior. Checked on x86_64. * posix/Makefile (tests): Add tst-spawn3. * posix/tst-spawn3.c: New file. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Close file descriptor if it is already opened for open action. [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn_file_actions_addclose.html
Diffstat (limited to 'posix/Makefile')
-rw-r--r--posix/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/posix/Makefile b/posix/Makefile
index 3a7719e..586d45b 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -94,7 +94,7 @@ tests := tstgetopt testfnm runtests runptests \
xtests := bug-ga2
ifeq (yes,$(build-shared))
test-srcs := globtest
-tests += wordexp-test tst-exec tst-spawn tst-spawn2
+tests += wordexp-test tst-exec tst-spawn tst-spawn2 tst-spawn3
endif
tests-static = tst-exec-static tst-spawn-static
tests += $(tests-static)