Changeset 7c1a82f in rtems


Ignore:
Timestamp:
05/23/00 15:41:04 (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
625f1a6
Parents:
1b69693
Message:

Patch from Jennifer Averett <jennifer.averett@…> to make
this C++ safe.

Location:
c/src/lib/libc
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libc/imfs.h

    r1b69693 r7c1a82f  
    151151  IMFS_jnode_t       *Parent;                /* Parent node */
    152152  char                name[IMFS_NAME_MAX+1]; /* "basename" */
    153   mode_t              stat_mode;             /* File mode */
    154   nlink_t             stat_nlink;            /* Link count */
    155   ino_t               stat_ino;              /* inode */
    156 
    157   uid_t               stat_uid;              /* User ID of owner */
    158   gid_t               stat_gid;              /* Group ID of owner */
    159 
    160   time_t              stat_atime;            /* Time of last access */
    161   time_t              stat_mtime;            /* Time of last modification */
    162   time_t              stat_ctime;            /* Time of last status change */
     153  mode_t              st_mode;               /* File mode */
     154  nlink_t             st_nlink;              /* Link count */
     155  ino_t               st_ino;                /* inode */
     156
     157  uid_t               st_uid;                /* User ID of owner */
     158  gid_t               st_gid;                /* Group ID of owner */
     159
     160  time_t              st_atime;              /* Time of last access */
     161  time_t              st_mtime;              /* Time of last modification */
     162  time_t              st_ctime;              /* Time of last status change */
    163163  IMFS_jnode_types_t  type;                  /* Type of this entry */
    164164  IMFS_types_union    info;
     
    169169    struct timeval tv;                      \
    170170    gettimeofday( &tv, 0 );                 \
    171     _jnode->stat_atime  = (time_t) tv.tv_sec; \
     171    _jnode->st_atime  = (time_t) tv.tv_sec; \
    172172  } while (0)
    173173               
     
    176176    struct timeval tv;                      \
    177177    gettimeofday( &tv, 0 );                 \
    178     _jnode->stat_mtime  = (time_t) tv.tv_sec; \
     178    _jnode->st_mtime  = (time_t) tv.tv_sec; \
    179179  } while (0)
    180180               
     
    183183    struct timeval tv;                      \
    184184    gettimeofday( &tv, 0 );                 \
    185     _jnode->stat_ctime  = (time_t) tv.tv_sec; \
     185    _jnode->st_ctime  = (time_t) tv.tv_sec; \
    186186  } while (0)
    187187
     
    190190    struct timeval tv;                      \
    191191    gettimeofday( &tv, 0 );                 \
    192     _jnode->stat_mtime  = (time_t) tv.tv_sec; \
    193     _jnode->stat_atime  = (time_t) tv.tv_sec; \
     192    _jnode->st_mtime  = (time_t) tv.tv_sec; \
     193    _jnode->st_atime  = (time_t) tv.tv_sec; \
    194194  } while (0)
    195195
  • c/src/lib/libc/imfs_chown.c

    r1b69693 r7c1a82f  
    3939  st_uid = geteuid();
    4040
    41   if ( ( st_uid != jnode->stat_uid ) && ( st_uid != 0 ) )
     41  if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) )
    4242    set_errno_and_return_minus_one( EPERM );
    4343#endif
    4444
    45   jnode->stat_uid = owner;
    46   jnode->stat_gid = group;
     45  jnode->st_uid = owner;
     46  jnode->st_gid = group;
    4747
    4848  IMFS_update_ctime( jnode );
  • c/src/lib/libc/imfs_creat.c

    r1b69693 r7c1a82f  
    4949   */
    5050
    51   node->stat_nlink = 1;
     51  node->st_nlink = 1;
    5252  node->type     = type;
    5353  strncpy( node->name, name, IMFS_NAME_MAX );
     
    5757   */
    5858
    59   node->stat_mode = mode & ~rtems_filesystem_umask;
     59  node->st_mode = mode & ~rtems_filesystem_umask;
    6060 
    6161#if defined(RTEMS_POSIX_API)
    62   node->stat_uid = geteuid();
    63   node->stat_gid = getegid();
     62  node->st_uid = geteuid();
     63  node->st_gid = getegid();
    6464#else
    65   node->stat_uid = 0;
    66   node->stat_gid = 0;
     65  node->st_uid = 0;
     66  node->st_gid = 0;
    6767#endif
    6868
     
    7373  gettimeofday( &tv, 0 );
    7474
    75   node->stat_atime  = (time_t) tv.tv_sec;
    76   node->stat_mtime  = (time_t) tv.tv_sec;
    77   node->stat_ctime  = (time_t) tv.tv_sec;
     75  node->st_atime  = (time_t) tv.tv_sec;
     76  node->st_mtime  = (time_t) tv.tv_sec;
     77  node->st_ctime  = (time_t) tv.tv_sec;
    7878
    7979  /*
     
    122122
    123123    fs_info = parent_loc->mt_entry->fs_info;
    124     node->stat_ino = ++fs_info->ino_count;
     124    node->st_ino = ++fs_info->ino_count;
    125125  }
    126126
  • c/src/lib/libc/imfs_directory.c

    r1b69693 r7c1a82f  
    241241
    242242   buf->st_dev = 0ll;
    243    buf->st_ino   = the_jnode->stat_ino;
    244    buf->st_mode  = the_jnode->stat_mode;
    245    buf->st_nlink = the_jnode->stat_nlink;
    246    buf->st_uid   = the_jnode->stat_uid;
    247    buf->st_gid   = the_jnode->stat_gid;
     243   buf->st_ino   = the_jnode->st_ino;
     244   buf->st_mode  = the_jnode->st_mode;
     245   buf->st_nlink = the_jnode->st_nlink;
     246   buf->st_uid   = the_jnode->st_uid;
     247   buf->st_gid   = the_jnode->st_gid;
    248248   buf->st_rdev = 0ll;
    249249   buf->st_blksize = 0;
    250250   buf->st_blocks = 0;
    251    buf->st_atime = the_jnode->stat_atime;
    252    buf->st_mtime = the_jnode->stat_mtime;
    253    buf->st_ctime = the_jnode->stat_ctime;
     251   buf->st_atime = the_jnode->st_atime;
     252   buf->st_mtime = the_jnode->st_mtime;
     253   buf->st_ctime = the_jnode->st_ctime;
    254254
    255255   buf->st_size = 0;
     
    318318   */
    319319
    320   the_jnode->stat_nlink--;
     320  the_jnode->st_nlink--;
    321321  IMFS_update_ctime( the_jnode );
    322322
     
    325325   */
    326326
    327   if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->stat_nlink < 1) ) {
     327  if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) {
    328328
    329329    /*
  • c/src/lib/libc/imfs_eval.c

    r1b69693 r7c1a82f  
    8383  st_gid = getegid();
    8484#else
    85   st_uid = jnode->stat_uid;
    86   st_gid = jnode->stat_gid;
     85  st_uid = jnode->st_uid;
     86  st_gid = jnode->st_gid;
    8787#endif
    8888 
     
    9393  flags_to_test = flags;
    9494
    95   if ( st_uid == jnode->stat_uid )
     95  if ( st_uid == jnode->st_uid )
    9696    flags_to_test <<= 6;
    97   else if ( st_gid == jnode->stat_gid )
     97  else if ( st_gid == jnode->st_gid )
    9898    flags_to_test <<= 3;
    9999  else
     
    104104   * to do this.
    105105   */
    106   if ( ( flags_to_test & jnode->stat_mode) == flags_to_test )
     106  if ( ( flags_to_test & jnode->st_mode) == flags_to_test )
    107107    return 1;
    108108
  • c/src/lib/libc/imfs_fchmod.c

    r1b69693 r7c1a82f  
    3535  st_uid = geteuid();
    3636
    37   if ( ( st_uid != jnode->stat_uid ) && ( st_uid != 0 ) )
     37  if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) )
    3838    set_errno_and_return_minus_one( EPERM );
    3939#endif
     
    4545    set_errno_and_return_minus_one( EPERM );
    4646
    47   jnode->stat_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO);
    48   jnode->stat_mode |= mode;
     47  jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO);
     48  jnode->st_mode |= mode;
    4949
    5050  IMFS_update_ctime( jnode );
  • c/src/lib/libc/imfs_initsupp.c

    r1b69693 r7c1a82f  
    7575
    7676  jnode = temp_mt_entry->mt_fs_root.node_access;
    77   jnode->stat_ino = fs_info->ino_count;
     77  jnode->st_ino = fs_info->ino_count;
    7878
    7979  return 0;
  • c/src/lib/libc/imfs_link.c

    r1b69693 r7c1a82f  
    3636
    3737  info.hard_link.link_node = to_loc->node_access;
    38   if ( info.hard_link.link_node->stat_nlink >= LINK_MAX )
     38  if ( info.hard_link.link_node->st_nlink >= LINK_MAX )
    3939    set_errno_and_return_minus_one( EMLINK );
    4040 
     
    6464   */
    6565
    66   info.hard_link.link_node->stat_nlink++;
     66  info.hard_link.link_node->st_nlink++;
    6767  IMFS_update_ctime( info.hard_link.link_node );
    6868
  • c/src/lib/libc/imfs_rmnod.c

    r1b69693 r7c1a82f  
    4646   */
    4747
    48   the_jnode->stat_nlink--;
     48  the_jnode->st_nlink--;
    4949  IMFS_update_ctime( the_jnode );
    5050
     
    5353   */
    5454
    55   if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->stat_nlink < 1) ) {
     55  if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) {
    5656
    5757    /*
  • c/src/lib/libc/imfs_stat.c

    r1b69693 r7c1a82f  
    4545  }
    4646
    47   buf->st_mode  = the_jnode->stat_mode;
    48   buf->st_nlink = the_jnode->stat_nlink;
    49   buf->st_ino   = the_jnode->stat_ino;
    50   buf->st_uid   = the_jnode->stat_uid;
    51   buf->st_gid   = the_jnode->stat_gid;
     47  buf->st_mode  = the_jnode->st_mode;
     48  buf->st_nlink = the_jnode->st_nlink;
     49  buf->st_ino   = the_jnode->st_ino;
     50  buf->st_uid   = the_jnode->st_uid;
     51  buf->st_gid   = the_jnode->st_gid;
    5252
    53   buf->st_atime = the_jnode->stat_atime;
    54   buf->st_mtime = the_jnode->stat_mtime;
    55   buf->st_ctime = the_jnode->stat_ctime;
     53  buf->st_atime = the_jnode->st_atime;
     54  buf->st_mtime = the_jnode->st_mtime;
     55  buf->st_ctime = the_jnode->st_ctime;
    5656
    5757  return 0;
  • c/src/lib/libc/imfs_unlink.c

    r1b69693 r7c1a82f  
    5454     */
    5555
    56     node->info.hard_link.link_node->stat_nlink --;
     56    node->info.hard_link.link_node->st_nlink --;
    5757    IMFS_update_ctime( node->info.hard_link.link_node );
    58     if ( node->info.hard_link.link_node->stat_nlink < 1) {
     58    if ( node->info.hard_link.link_node->st_nlink < 1) {
    5959      result = (*the_link.handlers->rmnod)( &the_link );
    6060      if ( result != 0 )
  • c/src/lib/libc/imfs_utime.c

    r1b69693 r7c1a82f  
    3131  the_jnode = (IMFS_jnode_t *) pathloc->node_access;
    3232
    33   the_jnode->stat_atime = actime;
    34   the_jnode->stat_mtime = modtime;
     33  the_jnode->st_atime = actime;
     34  the_jnode->st_mtime = modtime;
    3535
    3636  return 0;
  • c/src/lib/libc/memfile.c

    r1b69693 r7c1a82f  
    10651065   */
    10661066
    1067   the_jnode->stat_nlink--;
     1067  the_jnode->st_nlink--;
    10681068  IMFS_update_ctime( the_jnode );
    10691069
     
    10721072   */
    10731073
    1074   if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->stat_nlink < 1) ) {
     1074  if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) {
    10751075
    10761076    /*
Note: See TracChangeset for help on using the changeset viewer.