]> wimlib.net Git - wimlib/blobdiff - src/mount_image.c
win32_wglob(): Improve setting of errno
[wimlib] / src / mount_image.c
index 5829e6aaba05b2a7cb6e26f85ec2543a5e1bb907..1a8443e3f6d6c36533af7c0b91f23afa49ca16b4 100644 (file)
@@ -1526,10 +1526,12 @@ execute_fusermount(const char *dir, bool lazy)
                                 "terminate");
                return WIMLIB_ERR_FUSERMOUNT;
        }
-       if (status != 0) {
+
+       if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
                ERROR("`umount' did not successfully complete");
                return WIMLIB_ERR_FUSERMOUNT;
        }
+
        return 0;
 }
 
@@ -2029,7 +2031,7 @@ wimfs_readlink(const char *path, char *buf, size_t buf_len)
        if (!inode_is_symlink(inode))
                return -EINVAL;
        if (buf_len == 0)
-               return -ENAMETOOLONG;
+               return -EINVAL;
        ret = wim_inode_readlink(inode, buf, buf_len - 1, NULL);
        if (ret >= 0) {
                wimlib_assert(ret <= buf_len - 1);