mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
fuse: If guestfs_last_errno returns 0, don't return no error to FUSE layer.
guestfs_last_errno (g) == 0 doesn't mean "no error". It means the errno was not captured. In this case we have to substitute some sort of errno, so choose EINVAL arbitrarily.
This commit is contained in:
13
src/fuse.c
13
src/fuse.c
@@ -72,7 +72,18 @@ gl_lock_define_initialized (static, mount_local_lock);
|
||||
g->localmountpoint, __func__, ## __VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define RETURN_ERRNO return -guestfs_last_errno (g)
|
||||
#define RETURN_ERRNO \
|
||||
do { \
|
||||
int ret_errno = guestfs_last_errno (g); \
|
||||
\
|
||||
/* 0 doesn't mean "no error". It means the errno was not \
|
||||
* captured. Therefore we have to substitute an errno here. \
|
||||
*/ \
|
||||
if (ret_errno == 0) \
|
||||
ret_errno = EINVAL; \
|
||||
\
|
||||
return -ret_errno; \
|
||||
} while (0)
|
||||
|
||||
static struct guestfs_xattr_list *
|
||||
copy_xattr_list (const struct guestfs_xattr *first, size_t num)
|
||||
|
||||
Reference in New Issue
Block a user