Changeset cc5c4ac in rtems


Ignore:
Timestamp:
Aug 17, 2001, 1:18:01 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
6e46cf8f
Parents:
d62b0d52
Message:

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

  • libc/lseek.c: Modified after discussion with Eugeny S. Mints <jack@…> to correct the behavior. There were two mistakes. First, iop->offset was incorrectly set for SEEK_END. Second, iop->offset should be left unmodified if there are errors. This modification attempts to fix both situations.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/src/lseek.c

    rd62b0d52 rcc5c4ac  
    6969
    7070  status = (*iop->handlers->lseek_h)( iop, offset, whence );
    71   if ( !status )
    72     return 0;
     71  if ( status == (off_t) -1 )
     72    iop->offset = old_offset;
    7373
    7474  /*
     
    7676   */
    7777
    78   iop->offset = old_offset;
    7978  return status;
    8079}
  • c/src/lib/libc/lseek.c

    rd62b0d52 rcc5c4ac  
    6969
    7070  status = (*iop->handlers->lseek_h)( iop, offset, whence );
    71   if ( !status )
    72     return 0;
     71  if ( status == (off_t) -1 )
     72    iop->offset = old_offset;
    7373
    7474  /*
     
    7676   */
    7777
    78   iop->offset = old_offset;
    7978  return status;
    8079}
  • cpukit/libcsupport/src/lseek.c

    rd62b0d52 rcc5c4ac  
    6969
    7070  status = (*iop->handlers->lseek_h)( iop, offset, whence );
    71   if ( !status )
    72     return 0;
     71  if ( status == (off_t) -1 )
     72    iop->offset = old_offset;
    7373
    7474  /*
     
    7676   */
    7777
    78   iop->offset = old_offset;
    7978  return status;
    8079}
Note: See TracChangeset for help on using the changeset viewer.