Imported Upstream version 2.14.3
[platform/upstream/git.git] / builtin / unpack-file.c
index 73f1334..672a54f 100644 (file)
@@ -15,7 +15,7 @@ static char *create_temp_file(unsigned char *sha1)
 
        xsnprintf(path, sizeof(path), ".merge_file_XXXXXX");
        fd = xmkstemp(path);
-       if (write_in_full(fd, buf, size) != size)
+       if (write_in_full(fd, buf, size) < 0)
                die_errno("unable to write temp-file");
        close(fd);
        return path;