Skip to content

Commit 437dc11

Browse files
committed
bin/xbps-rindex: handle archive_errno returning -1
1 parent 50a4a96 commit 437dc11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/xbps-rindex/repoflush.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ open_archive(int fd, const char *compression)
8383
r = archive_write_open_fd(ar, fd);
8484
if (r != ARCHIVE_OK) {
8585
r = -archive_errno(ar);
86+
if (r == 1)
87+
r = -EINVAL;
8688
archive_write_free(ar);
8789
errno = -r;
8890
return NULL;
@@ -186,6 +188,8 @@ repodata_flush(const char *repodir,
186188
/* Write data to tempfile and rename */
187189
if (archive_write_close(ar) == ARCHIVE_FATAL) {
188190
r = -archive_errno(ar);
191+
if (r == 1)
192+
r = -EINVAL;
189193
xbps_error_printf("failed to close archive: %s\n", archive_error_string(ar));
190194
goto err;
191195
}

0 commit comments

Comments
 (0)