Merge branch 'master' of https://github.com/RT-Thread/rt-thread
This commit is contained in:
commit
369557a981
|
@ -641,7 +641,6 @@ int dfs_elm_stat(struct dfs_filesystem *fs, const char *path, struct stat *st)
|
||||||
|
|
||||||
st->st_size = file_info.fsize;
|
st->st_size = file_info.fsize;
|
||||||
st->st_mtime = file_info.ftime;
|
st->st_mtime = file_info.ftime;
|
||||||
st->st_blksize = 512;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _USE_LFN
|
#if _USE_LFN
|
||||||
|
|
|
@ -505,8 +505,6 @@ static int dfs_win32_stat(struct dfs_filesystem *fs, const char *path, struct st
|
||||||
st->st_mtime = time_tmp.QuadPart;
|
st->st_mtime = time_tmp.QuadPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
st->st_blksize = 0;
|
|
||||||
|
|
||||||
FindClose(hFind);
|
FindClose(hFind);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -97,7 +97,7 @@ static void set_stty(void)
|
||||||
tcsetattr(STDIN_FILENO, TCSANOW, &newt);
|
tcsetattr(STDIN_FILENO, TCSANOW, &newt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void restore_stty(void)
|
void restore_stty(void)
|
||||||
{
|
{
|
||||||
/* recover terminal's attribute */
|
/* recover terminal's attribute */
|
||||||
tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
|
tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
|
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
|
||||||
// #define RT_USING_PTHREADS
|
// #define RT_USING_PTHREADS
|
||||||
// <bool name="RT_USING_MODULE" description="Enable Moudle Application" default="true" />
|
// <bool name="RT_USING_MODULE" description="Enable Moudle Application" default="true" />
|
||||||
#define RT_USING_MODULE
|
// #define RT_USING_MODULE
|
||||||
// </section>
|
// </section>
|
||||||
|
|
||||||
// <section name="RT_USING_DFS" description="Device file system" default="true" >
|
// <section name="RT_USING_DFS" description="Device file system" default="true" >
|
||||||
|
|
|
@ -213,7 +213,6 @@ int dfs_device_fs_stat(struct dfs_filesystem *fs, const char *path, struct stat
|
||||||
|
|
||||||
st->st_size = 0;
|
st->st_size = 0;
|
||||||
st->st_mtime = 0;
|
st->st_mtime = 0;
|
||||||
st->st_blksize = 512;
|
|
||||||
|
|
||||||
return DFS_STATUS_OK;
|
return DFS_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
@ -238,7 +237,6 @@ int dfs_device_fs_stat(struct dfs_filesystem *fs, const char *path, struct stat
|
||||||
|
|
||||||
st->st_size = 0;
|
st->st_size = 0;
|
||||||
st->st_mtime = 0;
|
st->st_mtime = 0;
|
||||||
st->st_blksize = 512;
|
|
||||||
|
|
||||||
return DFS_STATUS_OK;
|
return DFS_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -738,7 +738,6 @@ int dfs_elm_stat(struct dfs_filesystem *fs, const char *path, struct stat *st)
|
||||||
st->st_mode &= ~(DFS_S_IWUSR | DFS_S_IWGRP | DFS_S_IWOTH);
|
st->st_mode &= ~(DFS_S_IWUSR | DFS_S_IWGRP | DFS_S_IWOTH);
|
||||||
|
|
||||||
st->st_size = file_info.fsize;
|
st->st_size = file_info.fsize;
|
||||||
st->st_blksize = 512;
|
|
||||||
|
|
||||||
/* get st_mtime. */
|
/* get st_mtime. */
|
||||||
{
|
{
|
||||||
|
|
|
@ -331,7 +331,7 @@ static int dfs_jffs2_open(struct dfs_fd* file)
|
||||||
return jffs2_result_to_dfs(result);
|
return jffs2_result_to_dfs(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save this pointer, it will be used when calling read()£¬write(),
|
/* save this pointer, it will be used when calling read()<EFBFBD><EFBFBD>write(),
|
||||||
flush(), lessk(), and will be rt_free when calling close()*/
|
flush(), lessk(), and will be rt_free when calling close()*/
|
||||||
file->data = jffs2_file;
|
file->data = jffs2_file;
|
||||||
file->pos = jffs2_file->f_offset;
|
file->pos = jffs2_file->f_offset;
|
||||||
|
@ -686,7 +686,6 @@ static int dfs_jffs2_stat(struct dfs_filesystem* fs, const char *path, struct st
|
||||||
st->st_dev = 0;
|
st->st_dev = 0;
|
||||||
st->st_size = s.st_size;
|
st->st_size = s.st_size;
|
||||||
st->st_mtime = s.st_mtime;
|
st->st_mtime = s.st_mtime;
|
||||||
st->st_blksize = 1;//fixme: what's this field?
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -850,7 +850,6 @@ int nfs_stat(struct dfs_filesystem *fs, const char *path, struct stat *st)
|
||||||
|
|
||||||
st->st_size = info->size;
|
st->st_size = info->size;
|
||||||
st->st_mtime = info->mtime.seconds;
|
st->st_mtime = info->mtime.seconds;
|
||||||
st->st_blksize = 512;
|
|
||||||
|
|
||||||
xdr_free((xdrproc_t)xdr_GETATTR3res, (char *)&res);
|
xdr_free((xdrproc_t)xdr_GETATTR3res, (char *)&res);
|
||||||
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)handle);
|
||||||
|
|
|
@ -292,7 +292,6 @@ int dfs_ramfs_stat(struct dfs_filesystem *fs,
|
||||||
|
|
||||||
st->st_size = dirent->size;
|
st->st_size = dirent->size;
|
||||||
st->st_mtime = 0;
|
st->st_mtime = 0;
|
||||||
st->st_blksize = 512;
|
|
||||||
|
|
||||||
return DFS_STATUS_OK;
|
return DFS_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,7 +245,6 @@ int dfs_romfs_stat(struct dfs_filesystem *fs, const char *path, struct stat *st)
|
||||||
|
|
||||||
st->st_size = dirent->size;
|
st->st_size = dirent->size;
|
||||||
st->st_mtime = 0;
|
st->st_mtime = 0;
|
||||||
st->st_blksize = 512;
|
|
||||||
|
|
||||||
return DFS_STATUS_OK;
|
return DFS_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -347,7 +347,7 @@ static int dfs_uffs_open(struct dfs_fd* file)
|
||||||
return uffs_result_to_dfs(uffs_get_error());
|
return uffs_result_to_dfs(uffs_get_error());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save this pointer, it will be used when calling read()£¬write(),
|
/* save this pointer, it will be used when calling read()<EFBFBD><EFBFBD>write(),
|
||||||
* flush(), seek(), and will be free when calling close()*/
|
* flush(), seek(), and will be free when calling close()*/
|
||||||
|
|
||||||
file->data = (void *)fd;
|
file->data = (void *)fd;
|
||||||
|
@ -619,7 +619,6 @@ static int dfs_uffs_stat(struct dfs_filesystem* fs, const char *path, struct sta
|
||||||
st->st_mtime = s.st_mtime;
|
st->st_mtime = s.st_mtime;
|
||||||
|
|
||||||
mtd = RT_MTD_NAND_DEVICE(fs->dev_id);
|
mtd = RT_MTD_NAND_DEVICE(fs->dev_id);
|
||||||
st->st_blksize = mtd->page_size;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,7 +261,6 @@ struct stat
|
||||||
rt_uint16_t st_mode;
|
rt_uint16_t st_mode;
|
||||||
rt_uint32_t st_size;
|
rt_uint32_t st_size;
|
||||||
rt_time_t st_mtime;
|
rt_time_t st_mtime;
|
||||||
rt_uint32_t st_blksize;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct statfs
|
struct statfs
|
||||||
|
|
|
@ -392,7 +392,6 @@ int dfs_file_stat(const char *path, struct stat *buf)
|
||||||
|
|
||||||
buf->st_size = 0;
|
buf->st_size = 0;
|
||||||
buf->st_mtime = 0;
|
buf->st_mtime = 0;
|
||||||
buf->st_blksize = 512;
|
|
||||||
|
|
||||||
/* release full path */
|
/* release full path */
|
||||||
rt_free(fullpath);
|
rt_free(fullpath);
|
||||||
|
|
|
@ -368,7 +368,6 @@ int fstat(int fildes, struct stat *buf)
|
||||||
|
|
||||||
buf->st_size = d->size;
|
buf->st_size = d->size;
|
||||||
buf->st_mtime = 0;
|
buf->st_mtime = 0;
|
||||||
buf->st_blksize = 512;
|
|
||||||
|
|
||||||
fd_put(d);
|
fd_put(d);
|
||||||
|
|
||||||
|
|
|
@ -1728,7 +1728,7 @@ static int fcntlSizeHint(rtthreadFile *pFile, i64 nByte){
|
||||||
** is the same technique used by glibc to implement posix_fallocate()
|
** is the same technique used by glibc to implement posix_fallocate()
|
||||||
** on systems that do not have a real fallocate() system call.
|
** on systems that do not have a real fallocate() system call.
|
||||||
*/
|
*/
|
||||||
int nBlk = buf.st_blksize; /* File-system block size */
|
int nBlk = 4096; // no blksize in RT-Thread, use 4096. /* File-system block size */
|
||||||
i64 iWrite; /* Next offset to write to */
|
i64 iWrite; /* Next offset to write to */
|
||||||
|
|
||||||
if( robust_ftruncate(pFile->h, nSize) ){
|
if( robust_ftruncate(pFile->h, nSize) ){
|
||||||
|
|
Loading…
Reference in New Issue