aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/tst-freopen2-main.c
diff options
context:
space:
mode:
authorJoseph Myers <josmyers@redhat.com>2024-09-05 11:15:29 +0000
committerJoseph Myers <josmyers@redhat.com>2024-09-05 11:15:29 +0000
commitf512634ddef242ef0ff025ddeba64ce51035040f (patch)
tree91d6f77fa7e52f87555d464df4169fbf421c17b8 /stdio-common/tst-freopen2-main.c
parentf169509ded534537eec9df00cfada6dbca908352 (diff)
downloadglibc-f512634ddef242ef0ff025ddeba64ce51035040f.zip
glibc-f512634ddef242ef0ff025ddeba64ce51035040f.tar.gz
glibc-f512634ddef242ef0ff025ddeba64ce51035040f.tar.bz2
Clear flags2 flags set from mode in freopen (bug 32134)
As reported in bug 32134, freopen does not clear the flags set in fp->_flags2 by the "e", "m" or "c" mode characters. Clear these so that they can be set or not as appropriate from the mode string passed to freopen. The relevant test for "e" in tst-freopen2-main.c is enabled accordingly; "c" is expected to be covered in a separately written test (and while tst-freopen2-main.c does include transitions to and from "m", that's not really a semantic flag intended to result in behaving in an observably different way). Tested for x86_64.
Diffstat (limited to 'stdio-common/tst-freopen2-main.c')
-rw-r--r--stdio-common/tst-freopen2-main.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/stdio-common/tst-freopen2-main.c b/stdio-common/tst-freopen2-main.c
index 22b21af..5dad41c 100644
--- a/stdio-common/tst-freopen2-main.c
+++ b/stdio-common/tst-freopen2-main.c
@@ -308,9 +308,7 @@ do_test (void)
TEST_VERIFY_EXIT (fp != NULL);
ret = fcntl (fileno (fp), F_GETFD);
TEST_VERIFY (ret != -1);
-#if 0 /* Fails to clear FD_CLOEXEC (bug 32134). */
TEST_COMPARE (ret & FD_CLOEXEC, 0);
-#endif
TEST_COMPARE_FILE_STRING (fp, "plustomore");
xfclose (fp);
END_TEST;