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 <sebastian.huber@embedded-brains.de>
This commit is contained in:
Sebastian Huber authored and Vijay Banerjee committed 2026-08-31 15:30:48 +00:00
1 parent ebcb51aadb
commit 5a96cb0f20
1 file changed
+3
+3
View File
@@ -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 */