From: Paul Eggert Date: Sun, 9 Nov 2025 21:29:03 +0000 (-0800) Subject: Make xclose static X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a109947a781f704ac69dd3511fb38187b288a392;p=thirdparty%2Ftar.git Make xclose static * src/buffer.c (xclose): Move from here ... * src/system.c: ... to here, and make it static. --- diff --git a/src/buffer.c b/src/buffer.c index a32c43b1..d9ffaa7d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -655,14 +655,6 @@ available_space_after (union block *pointer) return charptr (record_end) - charptr (pointer); } -/* Close file having descriptor FD, and abort if close unsuccessful. */ -void -xclose (int fd) -{ - if (close (fd) < 0) - close_error (_("(pipe)")); -} - static void init_buffer (void) { diff --git a/src/common.h b/src/common.h index 2cc89822..6296eacd 100644 --- a/src/common.h +++ b/src/common.h @@ -474,7 +474,6 @@ void print_total_stats (void); void reset_eof (void); void set_next_block_after (void *); void clear_read_error_count (void); -void xclose (int fd); _Noreturn void archive_write_error (ssize_t status); void archive_read_error (void); off_t seek_archive (off_t size); diff --git a/src/system.c b/src/system.c index f7a2b866..71494914 100644 --- a/src/system.c +++ b/src/system.c @@ -306,6 +306,14 @@ enum { PREAD, PWRITE }; # pragma GCC diagnostic ignored "-Wanalyzer-fd-leak" #endif +/* Close file having descriptor FD, and abort if close unsuccessful. */ +static void +xclose (int fd) +{ + if (close (fd) < 0) + close_error (_("(pipe)")); +} + /* Duplicate file descriptor FROM into becoming INTO. INTO is closed first and has to be the next available slot. */ static void