Changeset 4257974 in rtems


Ignore:
Timestamp:
12/26/02 15:48:48 (21 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
98e3a335
Parents:
b4e2f79
Message:

2002-12-26 Till Straumann <strauman@…

  • src/fchdir.c - PR302 fix violation of FS node object copy semantics
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/fchdir.c

    rb4e2f79 r4257974  
    3030{
    3131  rtems_libio_t *iop;
     32  rtems_filesystem_location_info_t loc, saved;
    3233 
    3334  rtems_libio_check_fd( fd );
     
    5859  }
    5960 
    60   rtems_filesystem_freenode( &rtems_filesystem_current );
    6161
    6262  /*
     
    6666   *         see the freenode interface but do not see
    6767   *         allocnode node interface. It maybe node_type.
     68   *
     69   * FIXED:  T.Straumann: it is evaluate_path()
     70   *         but note the race condition. Threads who
     71   *         share their rtems_filesystem_current better
     72   *         be synchronized!
    6873   */
    6974 
     75  saved                    = rtems_filesystem_current;
    7076  rtems_filesystem_current = iop->pathinfo;
     77 
     78  /* clone the current node */
     79  if (rtems_filesystem_evaluate_path(".", 0, &loc, 0)) {
     80    /* cloning failed; restore original and bail out */
     81    rtems_filesystem_current = saved;
     82        return -1;
     83  }
     84  /* release the old one */
     85  rtems_filesystem_freenode( &saved );
     86
     87  rtems_filesystem_current = loc;
    7188 
    7289  return 0;
    7390}
    74 
Note: See TracChangeset for help on using the changeset viewer.