Merge branch 'feature/vfs_serial_fcntl_get_rd_wr_state_v4.4' into 'release/v4.4'

vfs: uart/cdcacm/usb_serial_jtag fcntl return read/write state(v4.4)

See merge request espressif/esp-idf!19335
This commit is contained in:
morris
2023-04-03 19:15:15 +08:00
3 changed files with 3 additions and 1 deletions

View File

@@ -271,7 +271,7 @@ static int cdcacm_fcntl(int fd, int cmd, int arg)
assert(fd == 0); assert(fd == 0);
int result; int result;
if (cmd == F_GETFL) { if (cmd == F_GETFL) {
result = 0; result = O_RDWR;
if (!s_blocking) { if (!s_blocking) {
result |= O_NONBLOCK; result |= O_NONBLOCK;
} }

View File

@@ -299,6 +299,7 @@ static int uart_fcntl(int fd, int cmd, int arg)
assert(fd >=0 && fd < 3); assert(fd >=0 && fd < 3);
int result = 0; int result = 0;
if (cmd == F_GETFL) { if (cmd == F_GETFL) {
result |= O_RDWR;
if (s_ctx[fd]->non_blocking) { if (s_ctx[fd]->non_blocking) {
result |= O_NONBLOCK; result |= O_NONBLOCK;
} }

View File

@@ -245,6 +245,7 @@ static int usb_serial_jtag_fcntl(int fd, int cmd, int arg)
{ {
int result = 0; int result = 0;
if (cmd == F_GETFL) { if (cmd == F_GETFL) {
result |= O_RDWR;
if (s_ctx.non_blocking) { if (s_ctx.non_blocking) {
result |= O_NONBLOCK; result |= O_NONBLOCK;
} }