diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2025-08-05 09:16:14 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2025-08-05 12:14:54 -0700 |
commit | adec0bf05bc23ec35573c7a5b96440089b69265e (patch) | |
tree | 08b4e115de8dba9ff55f9a4a15cfbc046ddb845b | |
parent | 25258aef78ec301d25f61d8e5758eb28d3254d94 (diff) |
Revert "tst-freopen4-main.c: Call support_capture_subprocess with chroot"HEADorigin/masterorigin/HEADmaster
Revert commit 6463d4a7b28e5ee3891c34a8a1f0a59c24dfa9de to fix
FAIL: stdio-common/tst-freopen4-mem
FAIL: stdio-common/tst-freopen64-4-mem
This fixes BZ #33254.
Reviewed-by: Sam James <sam@gentoo.org>
-rw-r--r-- | stdio-common/tst-freopen4-main.c | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/stdio-common/tst-freopen4-main.c b/stdio-common/tst-freopen4-main.c index 436da4d203..3336f5327d 100644 --- a/stdio-common/tst-freopen4-main.c +++ b/stdio-common/tst-freopen4-main.c @@ -28,15 +28,25 @@ #include <support/test-driver.h> #include <support/xstdio.h> #include <support/xunistd.h> -#include <support/capture_subprocess.h> -static void -do_test_chroot (void *data) +int +do_test (void) { - char *temp_dir = (char *) data; + mtrace (); + char *temp_dir; FILE *fp; int ret; + /* These chroot tests verify that either reopening a renamed or + deleted file works even in the absence of /proc, or that it fails + (without memory leaks); thus, for example, such reopening does + not crash in the absence of /proc. */ + + support_become_root (); + if (!support_can_chroot ()) + return EXIT_UNSUPPORTED; + + temp_dir = support_create_temp_directory ("tst-freopen4"); xchroot (temp_dir); /* Test freopen with NULL, renamed file. This verifies that @@ -86,32 +96,6 @@ do_test_chroot (void *data) puts ("freopen of deleted file failed (OK)"); free (temp_dir); -} - -int -do_test (void) -{ - mtrace (); - char *temp_dir; - - /* These chroot tests verify that either reopening a renamed or - deleted file works even in the absence of /proc, or that it fails - (without memory leaks); thus, for example, such reopening does - not crash in the absence of /proc. */ - - support_become_root (); - if (!support_can_chroot ()) - return EXIT_UNSUPPORTED; - - temp_dir = support_create_temp_directory ("tst-freopen4"); - - struct support_capture_subprocess result; - result = support_capture_subprocess (do_test_chroot, temp_dir); - support_capture_subprocess_check (&result, "freopen4", 0, - sc_allow_stdout); - fputs (result.out.buffer, stdout); - support_capture_subprocess_free (&result); - return 0; } |