From 1ae6d818f0d57f527eda37d692bbb51ceb44fe06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 23 Jan 2019 17:40:23 +0100 Subject: [PATCH] Returned a low level error when an ioctl fails When an ioctl fails, the errno is not correctly propagated, and the log was wrong. --- libfuse-lite/fuse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libfuse-lite/fuse.c b/libfuse-lite/fuse.c index 52ff8d4d..256bed0f 100644 --- a/libfuse-lite/fuse.c +++ b/libfuse-lite/fuse.c @@ -2781,8 +2781,10 @@ static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, int cmd, void *arg, fuse_finish_interrupt(f, req, &d); free(path); - fuse_reply_ioctl(req, err, out_buf, out_bufsz); + if (err >= 0) { /* not an error */ + fuse_reply_ioctl(req, err, out_buf, out_bufsz); goto out; + } err: reply_err(req, err); out: