]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix typo in calls to close_file_descriptor function
authorSarah Gilmore <sgilmore@mathworks.com>
Fri, 24 Mar 2023 13:52:36 +0000 (09:52 -0400)
committerMartin Matuška <martin@matuska.de>
Thu, 13 Jul 2023 22:50:24 +0000 (00:50 +0200)
libarchive/archive_write_disk_posix.c

index 7ce25ea6cf958986f1aef61109ef1c6535d2456f..f29d21d569ea57a66f50e482a657a3dd9a58ec6b 100644 (file)
@@ -1732,7 +1732,7 @@ _archive_write_disk_finish_entry(struct archive *_a)
                                r = hfs_write_data_block(
                                    a, null_d, a->file_remaining_bytes);
                        if (r < 0)
-                close_file_descriptor(a->fd);
+                close_file_descriptor(a);
                                return ((int)r);
                }
 #endif
@@ -1742,7 +1742,7 @@ _archive_write_disk_finish_entry(struct archive *_a)
                    a->filesize == 0) {
                        archive_set_error(&a->archive, errno,
                            "File size could not be restored");
-            close_file_descriptor(a->fd);
+            close_file_descriptor(a);
                        return (ARCHIVE_FAILED);
                }
 #endif
@@ -1753,7 +1753,7 @@ _archive_write_disk_finish_entry(struct archive *_a)
                 */
                a->pst = NULL;
                if ((ret = lazy_stat(a)) != ARCHIVE_OK)
-            close_file_descriptor(a->fd);
+            close_file_descriptor(a);
                        return (ret);
                /* We can use lseek()/write() to extend the file if
                 * ftruncate didn't work or isn't available. */
@@ -1762,13 +1762,13 @@ _archive_write_disk_finish_entry(struct archive *_a)
                        if (lseek(a->fd, a->filesize - 1, SEEK_SET) < 0) {
                                archive_set_error(&a->archive, errno,
                                    "Seek failed");
-                close_file_descriptor(a->fd);
+                close_file_descriptor(a);
                                return (ARCHIVE_FATAL);
                        }
                        if (write(a->fd, &nul, 1) < 0) {
                                archive_set_error(&a->archive, errno,
                                    "Write to restore size failed");
-                close_file_descriptor(a->fd);
+                close_file_descriptor(a);
                                return (ARCHIVE_FATAL);
                        }
                        a->pst = NULL;