execute_fusermount(): Check status of 'umount' properly
authorEric Biggers <ebiggers3@gmail.com>
Sun, 12 Jan 2014 05:38:37 +0000 (23:38 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 12 Jan 2014 05:38:55 +0000 (23:38 -0600)
Code is only reached if fusermount command does not work.

src/mount_image.c

index 5829e6a..d8a9429 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;
 }