nshlib/testing: Fix open() arguments.

Pass explicit open flags for the NSH script redirect file so the mode argument is used as file creation permissions.

Add the missing mode argument to AIO ostest open() calls that create the test file.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
This commit is contained in:
Nightt 2026-05-19 17:43:05 +08:00 committed by Xiang Xiao
parent f9f59bd0f8
commit 5c703f5603
2 changed files with 9 additions and 8 deletions

View file

@ -61,7 +61,8 @@ static int nsh_script_redirect(FAR struct nsh_vtbl_s *vtbl,
if (CONFIG_NSH_SCRIPT_REDIRECT_PATH[0])
{
fd = open(CONFIG_NSH_SCRIPT_REDIRECT_PATH, 0666);
fd = open(CONFIG_NSH_SCRIPT_REDIRECT_PATH,
O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd > 0)
{
nsh_redirect(vtbl, 0, fd, fd, save);