From 476037803466e05471f46be0aed1a5de015a2d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Sun, 30 Mar 2025 11:11:33 +0200 Subject: [PATCH 1/2] fix(vfs): init vars so they aren't used uninitialized --- so3/fs/vfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/so3/fs/vfs.c b/so3/fs/vfs.c index 9dff444f8..46edea6bd 100644 --- a/so3/fs/vfs.c +++ b/so3/fs/vfs.c @@ -291,7 +291,7 @@ int vfs_set_open_mode(int gfd, uint32_t flags_open_mode) uint32_t vfs_get_access_mode(int gfd) { - uint32_t ret; + uint32_t ret = 0; mutex_lock(&vfs_lock); @@ -314,7 +314,7 @@ void vfs_set_access_mode(int gfd, uint32_t flags_access_mode) uint32_t vfs_get_operating_mode(int gfd) { - uint32_t ret; + uint32_t ret = 0; mutex_lock(&vfs_lock); if (open_fds[gfd]) From acfeaf76a7e5cd7f01d270c93d5f875471e14e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Sun, 30 Mar 2025 11:12:13 +0200 Subject: [PATCH 2/2] refactor(vfs): rename attribute to gfd for explicitness --- so3/include/vfs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/so3/include/vfs.h b/so3/include/vfs.h index 79203c831..53691772c 100644 --- a/so3/include/vfs.h +++ b/so3/include/vfs.h @@ -176,9 +176,9 @@ void vfs_set_priv(int gfd, void *data); void *vfs_get_priv(int gfd); int vfs_clone_fd(int *gfd_src, int *gfd_dst); -uint32_t vfs_get_access_mode(int fd); -uint32_t vfs_get_open_mode(int fd); -uint32_t vfs_get_operating_mode(int fd); +uint32_t vfs_get_access_mode(int gfd); +uint32_t vfs_get_open_mode(int gfd); +uint32_t vfs_get_operating_mode(int gfd); void vfs_set_access_mode(int gfd, uint32_t flags_access_mode); int vfs_set_open_mode(int gfd, uint32_t flags_open_mode);