From 5a96cb0f20a0bc2415036f1ed9440596bbcd2a4e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 24 Aug 2026 03:43:01 +0200 Subject: [PATCH] testsuites/psxtests: Fix the psx13 mode restore FutimensTest() restored the mode of its test file with a chmod() call which read fstat.st_mode before it ever called stat(). The structure held whatever the stack slot contained, so the file received a mode decided by the previous frame. On or1k that mode denied write access to the owner, and futimens( fd, NULL ) failed with EACCES. The other architectures passed because their stack held a usable mode. Read the mode with stat() right after the test opens the file. This follows UtimensatTest() in the same file. Built and run for or1k/generic_or1k on Qemu. psx13 passes with the change and fails without it. Close #5724. Assisted-by: Claude:claude-opus-5 claude-code Signed-off-by: Sebastian Huber --- testsuites/psxtests/psx13/test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testsuites/psxtests/psx13/test.c b/testsuites/psxtests/psx13/test.c index ab2e5c587a..08eadd27dc 100644 --- a/testsuites/psxtests/psx13/test.c +++ b/testsuites/psxtests/psx13/test.c @@ -822,6 +822,9 @@ static void FutimensTest( void ) fd = open( "testfile1.tst", O_RDWR ); rtems_test_assert( fd != -1 ); + rv = stat( "testfile1.tst", &fstat ); + rtems_test_assert( rv == 0 ); + /* EACCES test cases */ /* Case: When times is NULL and the user has insufficient privileges */