Changeset 44be50c in rtems


Ignore:
Timestamp:
12/28/09 16:36:08 (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 5, master
Children:
aea66e87
Parents:
e1ddc14b
Message:

2009-12-28 Shrikant Gaikwad <n3oo3n@…>

  • cpukit/libfs/src/pipe/pipe.c Restructured code to remove the goto statements.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    re1ddc14b r44be50c  
     12009-12-28      Shrikant Gaikwad <n3oo3n@gmail.com>
     2
     3        * cpukit/libfs/src/pipe/pipe.c Restructured code to remove the
     4        goto statements.
     5
    162009-12-21      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • cpukit/libcsupport/include/rtems/framebuffer.h

    re1ddc14b r44be50c  
    3333 *  a frame buffer device driver.
    3434 */
    35 #define FRAMEBUFFER_DRIVER_TABLE_ENTRY \
     35#define FRAME_BUFFER_DRIVER_TABLE_ENTRY \
    3636  { frame_buffer_initialize, frame_buffer_open, frame_buffer_close, \
    3737    frame_buffer_read, frame_buffer_write, frame_buffer_control }
  • cpukit/libfs/src/pipe/pipe.c

    re1ddc14b r44be50c  
    2929  rtems_libio_t *iop;
    3030  int err = 0;
    31 
    3231  /* Create /tmp if not exists */
    3332  if (rtems_filesystem_evaluate_path("/tmp", 3, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE)
     
    4847  /* Try creating FIFO file until find an available file name */
    4948  while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) {
    50     if (errno != EEXIST)
     49    if (errno != EEXIST){
    5150      return -1;
     51    }
    5252    /* Just try once... */
    5353    return -1;
     
    5959  if (filsdes[0] < 0) {
    6060    err = errno;
    61     goto out;
     61    /* Delete file at errors, or else if pipe is successfully created
     62     the file node will be deleted after it is closed by all. */
     63    unlink(fifopath);
     64  }
     65  else {
     66  /* Reset open file to blocking mode */
     67    iop = rtems_libio_iop(filsdes[0]);
     68    iop->flags &= ~LIBIO_FLAGS_NO_DELAY;
     69
     70    filsdes[1] = open(fifopath, O_WRONLY);
     71
     72    if (filsdes[1] < 0) {
     73    err = errno;
     74    close(filsdes[0]);
     75    }
     76  unlink(fifopath);
    6277  }
    6378
    64   /* Reset open file to blocking mode */
    65   iop = rtems_libio_iop(filsdes[0]);
    66   iop->flags &= ~LIBIO_FLAGS_NO_DELAY;
    67 
    68   filsdes[1] = open(fifopath, O_WRONLY);
    69 
    70   if (filsdes[1] < 0) {
    71     err = errno;
    72     close(filsdes[0]);
    73   }
    74 
    75 out:
    76   /* Delete file at errors, or else if pipe is successfully created
    77      the file node will be deleted after it is closed by all. */
    78   unlink(fifopath);
    79 
    80   if (! err)
    81     return 0;
    8279  rtems_set_errno_and_return_minus_one(err);
    8380}
     81
Note: See TracChangeset for help on using the changeset viewer.