Make xclose static

* src/buffer.c (xclose): Move from here ...
* src/system.c: ... to here, and make it static.
This commit is contained in:
Paul Eggert 2025-11-09 13:29:03 -08:00
parent 8fca2d35e8
commit a109947a78
3 changed files with 8 additions and 9 deletions

View File

@ -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)
{

View File

@ -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);

View File

@ -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