Skip to content

Commit b7ea6e4

Browse files
donghengqazespressif-bot
authored andcommitted
vfs: uart/cdcacm/usb_serial_jtag fcntl return read/write state
1 parent f3fc6f7 commit b7ea6e4

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

components/vfs/vfs_cdcacm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static int cdcacm_fcntl(int fd, int cmd, int arg)
271271
assert(fd == 0);
272272
int result;
273273
if (cmd == F_GETFL) {
274-
result = 0;
274+
result = O_RDWR;
275275
if (!s_blocking) {
276276
result |= O_NONBLOCK;
277277
}

components/vfs/vfs_uart.c

+1
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ static int uart_fcntl(int fd, int cmd, int arg)
299299
assert(fd >=0 && fd < 3);
300300
int result = 0;
301301
if (cmd == F_GETFL) {
302+
result |= O_RDWR;
302303
if (s_ctx[fd]->non_blocking) {
303304
result |= O_NONBLOCK;
304305
}

components/vfs/vfs_usb_serial_jtag.c

+1
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ static int usb_serial_jtag_fcntl(int fd, int cmd, int arg)
245245
{
246246
int result = 0;
247247
if (cmd == F_GETFL) {
248+
result |= O_RDWR;
248249
if (s_ctx.non_blocking) {
249250
result |= O_NONBLOCK;
250251
}

0 commit comments

Comments
 (0)