Changeset 4af849f in rtems


Ignore:
Timestamp:
Jul 7, 2010, 3:55:22 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
9d323a9
Parents:
4479b373
Message:

2010-07-07 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/open.c: Formatting and improve comment.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r4479b373 r4af849f  
     12010-07-07      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libcsupport/src/open.c: Formatting and improve comment.
     4
    152010-07-07      Joel Sherrill <joel.sherrill@oarcorp.com>
    26
  • cpukit/libcsupport/src/open.c

    r4479b373 r4af849f  
    22 *  open() - POSIX 1003.1 5.3.1 - Open a File
    33 *
    4  *  COPYRIGHT (c) 1989-1999.
     4 *  COPYRIGHT (c) 1989-2010.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    7373  int                                 eval_flags;
    7474
    75 
    7675  /*
    7776   * Set the Evaluation flags
    7877   */
    79 
    8078  eval_flags = 0;
    8179  status = flags + 1;
     
    110108   *  See if the file exists.
    111109   */
    112 
    113110  status = rtems_filesystem_evaluate_path(
    114111    pathname, strlen( pathname ), eval_flags, &loc, true );
     
    133130    }
    134131
    135     /* Sanity check to see if the file name exists after the mknod() */
    136     status = rtems_filesystem_evaluate_path( pathname, strlen( pathname ), 0x0, &loc, true );
     132    /*
     133     * After we do the mknod(), we have to evaluate the path to get the
     134     * "loc" structure needed to actually have the file itself open.
     135     * So we created it, and then we need to have "look it up."
     136     */
     137    status = rtems_filesystem_evaluate_path(
     138      pathname, strlen( pathname ), 0x0, &loc, true );
    137139    if ( status != 0 ) {   /* The file did not exist */
    138140      rc = EACCES;
     
    153155   *  returned by successful path evaluation.
    154156   */
    155 
    156157  iop->handlers   = loc.handlers;
    157158  iop->file_info  = loc.node_access;
     
    168169   *  Optionally truncate the file.
    169170   */
    170 
    171171  if ( (flags & O_TRUNC) == O_TRUNC ) {
    172172    rc = ftruncate( iop - rtems_libio_iops, 0 );
     
    183183   *  Single exit and clean up path.
    184184   */
    185 
    186185done:
    187186  va_end(ap);
Note: See TracChangeset for help on using the changeset viewer.