forked from Imagelibrary/rtems
Changed st_atime, st_ctime, and st_mtime for IMFS nodes to be
stat_ to avoid conflicts with macros on Solaris.
This commit is contained in:
@@ -157,9 +157,9 @@ struct IMFS_jnode_tt {
|
|||||||
uid_t st_uid; /* User ID of owner */
|
uid_t st_uid; /* User ID of owner */
|
||||||
gid_t st_gid; /* Group ID of owner */
|
gid_t st_gid; /* Group ID of owner */
|
||||||
|
|
||||||
time_t st_atime; /* Time of last access */
|
time_t stat_atime; /* Time of last access */
|
||||||
time_t st_mtime; /* Time of last modification */
|
time_t stat_mtime; /* Time of last modification */
|
||||||
time_t st_ctime; /* Time of last status change */
|
time_t stat_ctime; /* Time of last status change */
|
||||||
IMFS_jnode_types_t type; /* Type of this entry */
|
IMFS_jnode_types_t type; /* Type of this entry */
|
||||||
IMFS_types_union info;
|
IMFS_types_union info;
|
||||||
};
|
};
|
||||||
@@ -168,29 +168,29 @@ struct IMFS_jnode_tt {
|
|||||||
do { \
|
do { \
|
||||||
struct timeval tv; \
|
struct timeval tv; \
|
||||||
gettimeofday( &tv, 0 ); \
|
gettimeofday( &tv, 0 ); \
|
||||||
_jnode->st_atime = (time_t) tv.tv_sec; \
|
_jnode->stat_atime = (time_t) tv.tv_sec; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define IMFS_update_mtime( _jnode ) \
|
#define IMFS_update_mtime( _jnode ) \
|
||||||
do { \
|
do { \
|
||||||
struct timeval tv; \
|
struct timeval tv; \
|
||||||
gettimeofday( &tv, 0 ); \
|
gettimeofday( &tv, 0 ); \
|
||||||
_jnode->st_mtime = (time_t) tv.tv_sec; \
|
_jnode->stat_mtime = (time_t) tv.tv_sec; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define IMFS_update_ctime( _jnode ) \
|
#define IMFS_update_ctime( _jnode ) \
|
||||||
do { \
|
do { \
|
||||||
struct timeval tv; \
|
struct timeval tv; \
|
||||||
gettimeofday( &tv, 0 ); \
|
gettimeofday( &tv, 0 ); \
|
||||||
_jnode->st_ctime = (time_t) tv.tv_sec; \
|
_jnode->stat_ctime = (time_t) tv.tv_sec; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define IMFS_atime_mtime_update( _jnode ) \
|
#define IMFS_atime_mtime_update( _jnode ) \
|
||||||
do { \
|
do { \
|
||||||
struct timeval tv; \
|
struct timeval tv; \
|
||||||
gettimeofday( &tv, 0 ); \
|
gettimeofday( &tv, 0 ); \
|
||||||
_jnode->st_mtime = (time_t) tv.tv_sec; \
|
_jnode->stat_mtime = (time_t) tv.tv_sec; \
|
||||||
_jnode->st_atime = (time_t) tv.tv_sec; \
|
_jnode->stat_atime = (time_t) tv.tv_sec; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ IMFS_jnode_t *IMFS_create_node(
|
|||||||
|
|
||||||
gettimeofday( &tv, 0 );
|
gettimeofday( &tv, 0 );
|
||||||
|
|
||||||
node->st_atime = (time_t) tv.tv_sec;
|
node->stat_atime = (time_t) tv.tv_sec;
|
||||||
node->st_mtime = (time_t) tv.tv_sec;
|
node->stat_mtime = (time_t) tv.tv_sec;
|
||||||
node->st_ctime = (time_t) tv.tv_sec;
|
node->stat_ctime = (time_t) tv.tv_sec;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the type specific information
|
* Set the type specific information
|
||||||
|
|||||||
@@ -219,9 +219,9 @@ int imfs_dir_lseek(
|
|||||||
* dirent structure
|
* dirent structure
|
||||||
* st_blksize 0
|
* st_blksize 0
|
||||||
* st_blocks 0
|
* st_blocks 0
|
||||||
* st_atime time of last access
|
* stat_atime time of last access
|
||||||
* st_mtime time of last modification
|
* stat_mtime time of last modification
|
||||||
* st_ctime time of the last change
|
* stat_ctime time of the last change
|
||||||
*
|
*
|
||||||
* This information will be returned to the calling function in a -stat- struct
|
* This information will be returned to the calling function in a -stat- struct
|
||||||
*
|
*
|
||||||
@@ -248,9 +248,9 @@ int imfs_dir_fstat(
|
|||||||
buf->st_rdev = 0ll;
|
buf->st_rdev = 0ll;
|
||||||
buf->st_blksize = 0;
|
buf->st_blksize = 0;
|
||||||
buf->st_blocks = 0;
|
buf->st_blocks = 0;
|
||||||
buf->st_atime = the_jnode->st_atime;
|
buf->st_atime = the_jnode->stat_atime;
|
||||||
buf->st_mtime = the_jnode->st_mtime;
|
buf->st_mtime = the_jnode->stat_mtime;
|
||||||
buf->st_ctime = the_jnode->st_ctime;
|
buf->st_ctime = the_jnode->stat_ctime;
|
||||||
|
|
||||||
buf->st_size = 0;
|
buf->st_size = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ int IMFS_stat(
|
|||||||
buf->st_uid = the_jnode->st_uid;
|
buf->st_uid = the_jnode->st_uid;
|
||||||
buf->st_gid = the_jnode->st_gid;
|
buf->st_gid = the_jnode->st_gid;
|
||||||
|
|
||||||
buf->st_atime = the_jnode->st_atime;
|
buf->st_atime = the_jnode->stat_atime;
|
||||||
buf->st_mtime = the_jnode->st_mtime;
|
buf->st_mtime = the_jnode->stat_mtime;
|
||||||
buf->st_ctime = the_jnode->st_ctime;
|
buf->st_ctime = the_jnode->stat_ctime;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ int IMFS_utime(
|
|||||||
|
|
||||||
the_jnode = (IMFS_jnode_t *) pathloc->node_access;
|
the_jnode = (IMFS_jnode_t *) pathloc->node_access;
|
||||||
|
|
||||||
the_jnode->st_atime = actime;
|
the_jnode->stat_atime = actime;
|
||||||
the_jnode->st_mtime = modtime;
|
the_jnode->stat_mtime = modtime;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user