diff options
author | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-01-31 16:48:05 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-01-31 16:55:41 +0800 |
commit | 741e69664b44520e3f0606de486c4e64019b9395 (patch) | |
tree | fa1a3cde0598eeed44a00eaeb484968d5692607b | |
parent | 017f5b402d14c3ef7fc5a6b8371a11b9565754c3 (diff) | |
download | erofs-utils-741e69664b44520e3f0606de486c4e64019b9395.tar.gz |
erofs-utils: fuse: fix warnings on MacOS
Reported by the latest nightly build:
https://github.com/erofs/erofsnightly/actions/runs/4050082667/jobs/6969376259
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230131084805.2494-1-hsiangkao@linux.alibaba.com
-rw-r--r-- | fuse/main.c | 9 | ||||
-rw-r--r-- | 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; |