summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhujiale <[email protected]>2024-08-21 13:25:21 +0800
committerBernard Xiong <[email protected]>2024-08-24 14:44:39 +0800
commitafa17ed34328ec6587ce10dec223f97f2c2540e6 (patch)
treebe488d447d5674dbb4cfcfcd0ff9c8eeeb8da97d
parent416ec66380d89e2d3ff8ea37fd748ccc77130ab2 (diff)
fix_return_err
-rw-r--r--components/dfs/dfs_v2/filesystems/devfs/devfs.c2
-rw-r--r--components/lwp/lwp_syscall.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/components/dfs/dfs_v2/filesystems/devfs/devfs.c b/components/dfs/dfs_v2/filesystems/devfs/devfs.c
index 6db468fb5f..c8c66667db 100644
--- a/components/dfs/dfs_v2/filesystems/devfs/devfs.c
+++ b/components/dfs/dfs_v2/filesystems/devfs/devfs.c
@@ -265,7 +265,7 @@ static int dfs_devfs_flush(struct dfs_file *file)
static off_t dfs_devfs_lseek(struct dfs_file *file, off_t offset, int wherece)
{
- off_t ret = 0;
+ off_t ret = -EPERM;
rt_device_t device;
RT_ASSERT(file != RT_NULL);
diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c
index 90e881abbb..bbb0573c5c 100644
--- a/components/lwp/lwp_syscall.c
+++ b/components/lwp/lwp_syscall.c
@@ -461,7 +461,7 @@ ssize_t sys_write(int fd, const void *buf, size_t nbyte)
/* syscall: "lseek" ret: "off_t" args: "int" "off_t" "int" */
size_t sys_lseek(int fd, size_t offset, int whence)
{
- size_t ret = lseek(fd, offset, whence);
+ ssize_t ret = lseek(fd, offset, whence);
return (ret < 0 ? GET_ERRNO() : ret);
}