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