mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
driver/pipe: add nonblock open support
Change-Id: Ibdf627167b1a30e698607b4f32f6b1c8cc2f15ae Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -243,7 +243,8 @@ int pipecommon_open(FAR struct file *filep)
|
||||
sched_lock();
|
||||
nxsem_post(&dev->d_bfsem);
|
||||
|
||||
if ((filep->f_oflags & O_RDWR) == O_RDONLY && /* Read-only */
|
||||
if (!(filep->f_oflags & O_NONBLOCK) && /* Non-blocking */
|
||||
(filep->f_oflags & O_RDWR) == O_RDONLY && /* Read-only */
|
||||
dev->d_nwriters < 1 && /* No writers on the pipe */
|
||||
dev->d_wrndx == dev->d_rdndx) /* Buffer is empty */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user