!454 toybox update

Merge pull request !454 from Kiita/toybox_update
This commit is contained in:
openharmony_ci 2021-07-23 11:21:44 +00:00 committed by Gitee
commit 0dfa58ca5a
5 changed files with 24 additions and 9 deletions

View File

@ -1,7 +1,6 @@
CONFIG_GETTY=y
CONFIG_MDEV=y
CONFIG_MDEV_CONF=y
# CONFIG_BASENAME is not set
# CONFIG_CAL is not set
# CONFIG_CAT is not set
# CONFIG_CATV is not set
# CONFIG_CKSUM is not set
# CONFIG_CRC32 is not set
@ -13,6 +12,7 @@ CONFIG_MDEV_CONF=y
# CONFIG_CUT is not set
# CONFIG_DF is not set
# CONFIG_DIRNAME is not set
# CONFIG_ECHO is not set
# CONFIG_ENV is not set
# CONFIG_EXPAND is not set
# CONFIG_FALSE is not set
@ -178,3 +178,9 @@ CONFIG_MDEV_CONF=y
# CONFIG_SEQ is not set
# CONFIG_SU is not set
# CONFIG_SYNC is not set
#
# pending (see toys/pending/README)
#
# CONFIG_GETTY is not set
# CONFIG_MDEV is not set
# CONFIG_MDEV_CONF is not set

View File

@ -1416,6 +1416,9 @@ int fatfs_stat(struct Vnode *vp, struct stat* sp)
time = fattime_transfer(finfo->fdate, finfo->ftime);
sp->st_mtime = time;
/* Adapt to kstat member "long tv_sec" */
sp->__st_mtim32.tv_sec = (long)time;
unlock_fs(fs, FR_OK);
return 0;
}

View File

@ -807,6 +807,11 @@ int VfsJffs2Stat(struct Vnode *pVnode, struct stat *buf)
buf->st_mtime = node->i_mtime;
buf->st_ctime = node->i_ctime;
/* Adapt to kstat member long tv_sec */
buf->__st_atim32.tv_sec = (long)node->i_atime;
buf->__st_mtim32.tv_sec = (long)node->i_mtime;
buf->__st_ctim32.tv_sec = (long)node->i_ctime;
LOS_MuxUnlock(&g_jffs2FsLock);
return 0;

View File

@ -1206,7 +1206,7 @@ OUT:
return ret;
}
int SysStat(const char *path, struct stat *buf)
int SysStat(const char *path, struct kstat *buf)
{
int ret;
char *pathRet = NULL;
@ -1225,7 +1225,7 @@ int SysStat(const char *path, struct stat *buf)
goto OUT;
}
ret = LOS_ArchCopyToUser(buf, &bufRet, sizeof(struct stat));
ret = LOS_ArchCopyToUser(buf, &bufRet, sizeof(struct kstat));
if (ret != 0) {
ret = -EFAULT;
}
@ -1237,7 +1237,7 @@ OUT:
return ret;
}
int SysLstat(const char *path, struct stat *buffer)
int SysLstat(const char *path, struct kstat *buffer)
{
int ret;
char *pathRet = NULL;
@ -1256,7 +1256,7 @@ int SysLstat(const char *path, struct stat *buffer)
goto OUT;
}
ret = LOS_ArchCopyToUser(buffer, &bufRet, sizeof(struct stat));
ret = LOS_ArchCopyToUser(buffer, &bufRet, sizeof(struct kstat));
if (ret != 0) {
ret = -EFAULT;
}

View File

@ -55,6 +55,7 @@
#include "time.h"
#include "sys/time.h"
#include "sys/stat.h"
#include "sys/kstat.h"
#ifdef LOSCFG_FS_VFS
#include "sys/socket.h"
#include "dirent.h"
@ -252,8 +253,8 @@ extern int SysFtruncate(int fd, off_t length);
extern int SysStatfs(const char *path, struct statfs *buf);
extern int SysStatfs64(const char *path, size_t sz, struct statfs *buf);
extern int SysStat(const char *path, struct stat *buf);
extern int SysLstat(const char *path, struct stat *buffer);
extern int SysStat(const char *path, struct kstat *buf);
extern int SysLstat(const char *path, struct kstat *buffer);
extern int SysFstat(int fildes, struct stat *buf);
extern int SysStatx(int fd, const char *restrict path, int flag, unsigned mask, struct statx *restrict stx);
extern int SysFsync(int fd);