>
> - if ((*new)->filedes < 0 && (*new)->filehand == NULL) {
> + if ((*new)->filedes < 0 || (*new)->filehand == NULL) {
> (*new)->filedes = -1;
> (*new)->eof_hit = 1;
> return errno;
This is wrong. This says that we NEVER open the file correctly. This is
because we only ever set one of the two options, either the filedes or the
filehand, NEVER both. We are checking for the error condition, not the
successful case. Either the filedes or the filehand WILL be not set after
each open. I have serious doubts that the code even works anymore. If
it does, it is only because we aren't checking return code properly.
Ryan
_______________________________________________________________________
Ryan Bloom rbb@raleigh.ibm.com
4205 S Miami Blvd
RTP, NC 27709 It's a beautiful sight to see good dancers
doing simple steps. It's a painful sight to
see beginners doing complicated patterns.
|