[Bug 1542] pipe_control_t is not deallocated if fifo_open is attempted with O_WRONLY | O_NONBLOCK

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Jun 1 09:01:37 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1542





--- Comment #1 from Bharath Suri <bharath.s.jois at gmail.com>  2010-06-01 04:01:36 ---
Observation and Possible solution:

Observation:
In pipe_release,

The mode of the pipe is checked and correspondingly the writers or readers of
pipe is decremented
If number of readers = number of writers = 0, free the pipe

In this case, we see that on call to release, pipe->Writers == 0 and up on
decrement, there is a wrap around and the deallocation does not happen.

Proposal:

In fifo_open, as done in the case of mode = READ, we could
- Increment the number of writers and then
- check for the non-block mode and number of readers = 0
- If error, Call the pipe_release after setting errno = ENXIO

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list