cdda, fat, iso9660: clear tv_nsecs fields in the stat struct
* devfs in fact doesn't provide a zeroed buffer.
This commit is contained in:
@@ -528,9 +528,12 @@ fill_stat_buffer(Volume* volume, Inode* inode, Attribute* attribute,
|
||||
stat.st_uid = inode->UserID();
|
||||
stat.st_gid = inode->GroupID();
|
||||
|
||||
stat.st_atime = time(NULL);
|
||||
stat.st_mtime = stat.st_ctime = inode->ModificationTime();
|
||||
stat.st_crtime = inode->CreationTime();
|
||||
stat.st_atim.tv_sec = time(NULL);
|
||||
stat.st_atim.tv_nsec = 0;
|
||||
stat.st_mtim.tv_sec = stat.st_ctim.tv_sec = inode->ModificationTime();
|
||||
stat.st_ctim.tv_nsec = stat.st_mtim.tv_nsec = 0;
|
||||
stat.st_crtim.tv_sec = inode->CreationTime();
|
||||
stat.st_crtim.tv_nsec = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -180,7 +180,10 @@ dosfs_rstat(fs_volume *_vol, fs_vnode *_node, struct stat *st)
|
||||
st->st_size = node->st_size;
|
||||
st->st_blocks = (node->st_size + 511) / 512;
|
||||
st->st_blksize = 0x10000; /* this value was chosen arbitrarily */
|
||||
st->st_atime = st->st_mtime = st->st_ctime = st->st_crtime = node->st_time;
|
||||
st->st_atim.tv_sec = st->st_mtim.tv_sec = st->st_ctim.tv_sec =
|
||||
st->st_crtim.tv_sec = node->st_time;
|
||||
st->st_atim.tv_nsec = st->st_mtim.tv_nsec = st->st_ctim.tv_nsec =
|
||||
st->st_crtim.tv_nsec = 0;
|
||||
|
||||
UNLOCK_VOL(vol);
|
||||
|
||||
|
||||
@@ -492,8 +492,10 @@ fs_read_stat(fs_volume* _volume, fs_vnode* _node, struct stat* st)
|
||||
// Same for file/dir in ISO9660
|
||||
st->st_size = node->dataLen[FS_DATA_FORMAT];
|
||||
st->st_blocks = (st->st_size + 511) / 512;
|
||||
if (ConvertRecDate(&(node->recordDate), &time) == B_NO_ERROR)
|
||||
st->st_ctime = st->st_mtime = st->st_atime = time;
|
||||
if (ConvertRecDate(&(node->recordDate), &time) == B_NO_ERROR) {
|
||||
st->st_ctim.tv_sec = st->st_mtim.tv_sec = st->st_atim.tv_sec = time;
|
||||
st->st_ctim.tv_nsec = st->st_mtim.tv_nsec = st->st_atim.tv_nsec = 0;
|
||||
}
|
||||
|
||||
TRACE(("fs_read_stat - EXIT, result is %s\n", strerror(result)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user