[PATCH] erofs-utils: fuse: fix warnings on MacOS

Gao Xiang hsiangkao at linux.alibaba.com
Tue Jan 31 19:48:05 AEDT 2023


Reported by the latest nightly build:
https://github.com/erofs/erofsnightly/actions/runs/4050082667/jobs/6969376259

Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
 fuse/main.c  | 9 +++++++--
 lib/config.c | 3 ++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/fuse/main.c b/fuse/main.c
index f1d1b47..e6af890 100644
--- a/fuse/main.c
+++ b/fuse/main.c
@@ -143,7 +143,12 @@ static int erofsfuse_readlink(const char *path, char *buffer, size_t size)
 }
 
 static int erofsfuse_getxattr(const char *path, const char *name, char *value,
-			size_t size)
+			size_t size
+#ifdef __APPLE__
+			, uint32_t position)
+#else
+			)
+#endif
 {
 	int ret;
 	struct erofs_inode vi;
@@ -227,7 +232,7 @@ static void usage(void)
 static void erofsfuse_dumpcfg(void)
 {
 	erofs_dump("disk: %s\n", fusecfg.disk);
-	erofs_dump("offset: %lu\n", fusecfg.offset);
+	erofs_dump("offset: %llu\n", fusecfg.offset | 0ULL);
 	erofs_dump("mountpoint: %s\n", fusecfg.mountpoint);
 	erofs_dump("dbglevel: %u\n", cfg.c_dbg_lvl);
 }
diff --git a/lib/config.c b/lib/config.c
index 3963df2..20200be 100644
--- a/lib/config.c
+++ b/lib/config.c
@@ -100,10 +100,11 @@ static bool __erofs_is_progressmsg;
 
 char *erofs_trim_for_progressinfo(const char *str, int placeholder)
 {
-	struct winsize winsize;
 	int col, len;
 
 #ifdef GWINSZ_IN_SYS_IOCTL
+	struct winsize winsize;
+
 	if(ioctl(1, TIOCGWINSZ, &winsize) >= 0 &&
 	   winsize.ws_col > 0)
 		col = winsize.ws_col;
-- 
2.24.4



More information about the Linux-erofs mailing list