michallenc commented on code in PR #10602: URL: https://github.com/apache/nuttx/pull/10602#discussion_r1350712432
########## fs/vfs/fs_fdopen.c: ########## @@ -120,7 +120,7 @@ int fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb, /* Check input parameters */ - if (fd < 0) + if (fd < 0 && cookie == 0) Review Comment: @xiaoxiang781216 This is basically just a information passed to fs_fdopen that initialization is done for fopencookie (1 true) and not standard stream (0 false). It is not to pass the pointer to cookie. The implementation with pointer to cookie would be tricky because we need valid fd to pass the checks (and we need -1 reserved if open call returns error). This adds two more if statements but does not complicate the code more. Applies to most other comments. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org