use xfopen() in more places
[gitweb.git] / builtin / fsck.c
index b5e13a45560f9338a65191c22d213f33052bf9b9..00beaaa4e6edc7d644f43a6503aa895eb6d934c4 100644 (file)
@@ -280,8 +280,7 @@ static void check_unreachable_object(struct object *obj)
                                free(filename);
                                return;
                        }
-                       if (!(f = fopen(filename, "w")))
-                               die_errno("Could not open '%s'", filename);
+                       f = xfopen(filename, "w");
                        if (obj->type == OBJ_BLOB) {
                                if (stream_blob_to_fd(fileno(f), &obj->oid, NULL, 1))
                                        die_errno("Could not write '%s'", filename);