OSDN Git Service

Returned a low level error when an ioctl fails
authorJean-Pierre André <jean-pierre.andre@wanadoo.fr>
Wed, 23 Jan 2019 16:40:23 +0000 (17:40 +0100)
committerJean-Pierre André <jean-pierre.andre@wanadoo.fr>
Wed, 23 Jan 2019 16:40:23 +0000 (17:40 +0100)
When an ioctl fails, the errno is not correctly propagated, and the
log was wrong.

libfuse-lite/fuse.c

index 52ff8d4..256bed0 100644 (file)
@@ -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: