Changeset 770f6e9 in rtems


Ignore:
Timestamp:
Aug 17, 2001, 1:17:04 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
ca739de3
Parents:
45e1417
Message:

2001-08-17 Joel Sherrill <joel@…>

  • libc/lseek.c: Fix minor bug introduced by misinterpretation of return code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libc/lseek.c

    r45e1417 r770f6e9  
    1212 */
    1313
     14#if HAVE_CONFIG_H
     15#include "config.h"
     16#endif
     17
    1418#include <stdio.h>
    1519
    16 #include "libio_.h"
     20#include <rtems/libio_.h>
    1721
    1822off_t lseek(
     
    3438   */
    3539
    36   if ( !iop->handlers->lseek )
     40  if ( !iop->handlers->lseek_h )
    3741    set_errno_and_return_minus_one( ENOTSUP );
    3842
     
    6468   */
    6569
    66   status = (*iop->handlers->lseek)( iop, offset, whence );
    67   if ( !status )
    68     return 0;
     70  status = (*iop->handlers->lseek_h)( iop, offset, whence );
     71  if ( status == (off_t) -1 )
     72    iop->offset = old_offset;
    6973
    7074  /*
     
    7276   */
    7377
    74   iop->offset = old_offset;
    7578  return status;
    7679}
Note: See TracChangeset for help on using the changeset viewer.