diff options
Diffstat (limited to 'cpukit/libfs/src/pipe/fifo.c')
-rw-r--r-- | cpukit/libfs/src/pipe/fifo.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/cpukit/libfs/src/pipe/fifo.c b/cpukit/libfs/src/pipe/fifo.c index 31ccfc8193..ca33f6aadb 100644 --- a/cpukit/libfs/src/pipe/fifo.c +++ b/cpukit/libfs/src/pipe/fifo.c @@ -622,24 +622,23 @@ int pipe_ioctl( { int rv = 0; - if (buffer != NULL) { - if (PIPE_LOCK(pipe)) { - switch (cmd) { - case RTEMS_IOCTL_SELECT: - rv = pipe_select(pipe, buffer); - break; - case FIONREAD: - /* Return length of pipe */ - *(unsigned int *) buffer = pipe->Length; - break; - } - - PIPE_UNLOCK(pipe); - } else { - rv = -EINTR; + if (PIPE_LOCK(pipe)) { + switch (cmd) { + case RTEMS_IOCTL_SELECT: + rv = pipe_select(pipe, buffer); + break; + case FIONREAD: + /* Return length of pipe */ + *(unsigned int *) buffer = pipe->Length; + break; + default: + rv = -EINVAL; + break; } + + PIPE_UNLOCK(pipe); } else { - rv = -EFAULT; + rv = -EINTR; } return rv; |