From 296a546bcd18f8174d4aa15f2fa24021e3f44679 Mon Sep 17 00:00:00 2001 From: Far Date: Sat, 15 Oct 2022 17:35:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=9D=99=E6=80=81=E6=89=AB=E6=8F=8F=E5=B7=A5=E5=85=B7=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4890de0066f33bf44e913b550edfa3639bce7caf Signed-off-by: Far --- components/fs/vfs/vfs_files.c | 2 +- components/fs/vfs/vfs_files.h | 2 +- components/fs/vfs/vfs_mount.c | 2 +- kal/posix/src/poll.c | 2 +- kal/posix/src/pthread_cond.c | 6 ------ 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/components/fs/vfs/vfs_files.c b/components/fs/vfs/vfs_files.c index f05bee1a..d62ed9df 100644 --- a/components/fs/vfs/vfs_files.c +++ b/components/fs/vfs/vfs_files.c @@ -39,7 +39,7 @@ static struct File g_files[NR_OPEN_DEFAULT]; -int FileToFd(struct File *file) +int FileToFd(const struct File *file) { if (file == NULL) { return (int)LOS_NOK; diff --git a/components/fs/vfs/vfs_files.h b/components/fs/vfs/vfs_files.h index ac7b7ff0..180aedbf 100644 --- a/components/fs/vfs/vfs_files.h +++ b/components/fs/vfs/vfs_files.h @@ -89,7 +89,7 @@ struct Dir { void *dData; }; -int FileToFd(struct File *file); +int FileToFd(const struct File *file); struct File *FdToFile(int fd); struct File *VfsFileGet(void); struct File *VfsFileGetSpec(int fd); diff --git a/components/fs/vfs/vfs_mount.c b/components/fs/vfs/vfs_mount.c index 3bb2a327..b92792ad 100644 --- a/components/fs/vfs/vfs_mount.c +++ b/components/fs/vfs/vfs_mount.c @@ -251,7 +251,7 @@ errout: return (int)LOS_NOK; } -static void CloseFdsInMp(struct MountPoint *mp) +static void CloseFdsInMp(const struct MountPoint *mp) { for (int fd = 0; fd < NR_OPEN_DEFAULT; fd++) { struct File *f = FdToFile(fd); diff --git a/kal/posix/src/poll.c b/kal/posix/src/poll.c index 2bf82e08..1a25e86c 100644 --- a/kal/posix/src/poll.c +++ b/kal/posix/src/poll.c @@ -175,7 +175,7 @@ STATIC INLINE INT32 PollTimedWait(struct pollfd *fds, nfds_t nfds, struct PollTa } } else if (left <= 0) { break; - } else if (left > 0) { + } else { clock_gettime(CLOCK_REALTIME, &curTime); last = (INT32)((curTime.tv_sec - startTime.tv_sec) * OS_SYS_MS_PER_SECOND + (curTime.tv_nsec - startTime.tv_nsec) / (OS_SYS_NS_PER_SECOND / OS_SYS_MS_PER_SECOND)); diff --git a/kal/posix/src/pthread_cond.c b/kal/posix/src/pthread_cond.c index b5a230b0..fde08678 100644 --- a/kal/posix/src/pthread_cond.c +++ b/kal/posix/src/pthread_cond.c @@ -42,12 +42,6 @@ #include "los_event.h" #include "los_mux.h" -typedef struct { - volatile INT32 *realValue; - INT32 value; - UINT32 clearEvent; -} EventCond; - #define INLINE inline #define BROADCAST_EVENT 1