mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/vfs_serial_fcntl_get_rd_wr_state' into 'master'
vfs: uart/cdcacm/usb_serial_jtag fcntl return read/write state See merge request espressif/esp-idf!19168
This commit is contained in:
commit
a16431c7a9
@ -271,7 +271,7 @@ static int cdcacm_fcntl(int fd, int cmd, int arg)
|
||||
assert(fd == 0);
|
||||
int result;
|
||||
if (cmd == F_GETFL) {
|
||||
result = 0;
|
||||
result = O_RDWR;
|
||||
if (!s_blocking) {
|
||||
result |= O_NONBLOCK;
|
||||
}
|
||||
|
@ -299,6 +299,7 @@ static int uart_fcntl(int fd, int cmd, int arg)
|
||||
assert(fd >=0 && fd < 3);
|
||||
int result = 0;
|
||||
if (cmd == F_GETFL) {
|
||||
result |= O_RDWR;
|
||||
if (s_ctx[fd]->non_blocking) {
|
||||
result |= O_NONBLOCK;
|
||||
}
|
||||
|
@ -245,6 +245,7 @@ static int usb_serial_jtag_fcntl(int fd, int cmd, int arg)
|
||||
{
|
||||
int result = 0;
|
||||
if (cmd == F_GETFL) {
|
||||
result |= O_RDWR;
|
||||
if (s_ctx.non_blocking) {
|
||||
result |= O_NONBLOCK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user