Files
valgrind/none/tests/track_high.vgtest
Alexandra Hájková ebd7dd5ea9 Add "yes" argument for the --modify-fds option.
Use --modify-fds=yes to restrict the option from affecting
the 0/1/2 file descriptors as they're often used for
stdin/tdout/stderr redirection.

The new possibility is named "yes" because "yes" is used
as the default in general. The default behaviour of the --modify-fds
option is then such, that highest available file descriptor is returned
execept when the lowest stdin/stdout/stderr (0, 1, 2) are available.

For example, if we want to redirect stdout to stderr by closing stdout
(file descriptor 1) and then calling dup (), file descriptor 1 will be
returned and not the highest number available. This is because the
following is a common pattern to redirect stdout to stderr:

close (1);
/* stdout becomes stderr */
ret = dup (2);

Add none/tests/track_yes.vgtest and none/tests/track_high.vgtest
tests to test --modify-fds=yes/high behave as expected.

https://bugs.kde.org/show_bug.cgi?id=502359
2025-05-22 16:13:56 +02:00

5 lines
91 B
Plaintext

prog: track_std
vgopts: -q --track-fds=yes --modify-fds=high
stderr_filter: filter_fdleak