Skip to content

Commit

Permalink
nxrecorder: mode is required when oflags include O_CREAT or O_WRONLY
Browse files Browse the repository at this point in the history
Refer -- fs_open.c:
/* If the file is opened for creation, then get the mode bits */

  if ((oflags & (O_WRONLY | O_CREAT)) != 0)
    {
      mode = va_arg(ap, mode_t);
    }

Signed-off-by: huxiandong <[email protected]>
  • Loading branch information
huxiandong committed Aug 11, 2023
1 parent 34f71ec commit 556390a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/nxrecorder/nxrecorder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,8 @@ int nxrecorder_recordinternal(FAR struct nxrecorder_s *precorder,

/* Test that the specified file exists */

if ((precorder->fd = open(pfilename, O_WRONLY | O_CREAT | O_TRUNC)) == -1)
if ((precorder->fd = open(pfilename, O_WRONLY | O_CREAT | O_TRUNC,
0666)) == -1)
{
/* File not found. Test if its in the mediadir */

Expand Down

0 comments on commit 556390a

Please sign in to comment.