extract_wim_resource_to_fd(): Handle full_write() retval correctly
authorEric Biggers <ebiggers3@gmail.com>
Sun, 30 Sep 2012 21:55:49 +0000 (16:55 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 30 Sep 2012 21:55:49 +0000 (16:55 -0500)
src/resource.c

index 11e8c7dc6cc91bf3fe901567bfb427e65edeb0a4..f7a7916e5f0cc0ed94bcae2b30673b500f80db4b 100644 (file)
@@ -1013,7 +1013,7 @@ int extract_wim_resource_to_fd(const struct lookup_table_entry *lte, int fd,
                if (ret != 0)
                        break;
                sha1_update(&ctx, buf, to_read);
-               if (full_write(fd, buf, to_read) < 0) {
+               if (full_write(fd, buf, to_read) < to_read) {
                        ERROR_WITH_ERRNO("Error extracting WIM resource");
                        return WIMLIB_ERR_WRITE;
                }