From 27068d3308ab3554909e62ffdd1ac5f27249217b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 27 Feb 2021 14:20:46 -0800 Subject: paxtest: fix link issue and pacify GCC 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * paxtest/paxtest.c (xalloc_die): Call exit explicitly, to pacify GCC 10. (fatal_exit): New function; otherwise paxtest doesn’t link. --- paxtest/paxtest.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/paxtest/paxtest.c b/paxtest/paxtest.c index 5bbfc3c..bf839ac 100644 --- a/paxtest/paxtest.c +++ b/paxtest/paxtest.c @@ -31,7 +31,15 @@ void xalloc_die (void) { - error(1, ENOMEM, "Exiting"); + error (0, ENOMEM, "Exiting"); + exit (1); +} + +void +fatal_exit (void) +{ + error (0, 0, "Fatal error"); + exit (1); } void @@ -45,7 +53,7 @@ dump (unsigned char *buf, size_t size) printf ("\n"); } } - + void read_and_dump (paxbuf_t pbuf) @@ -53,7 +61,7 @@ read_and_dump (paxbuf_t pbuf) union block block; size_t size; pax_io_status_t rc; - + while ((rc = paxbuf_read (pbuf, block.buffer, sizeof block, &size)) == pax_io_success) { @@ -73,7 +81,7 @@ main (int argc, char **argv) error (1, 0, "Not enough arguments"); tar_archive_create (&pbuf, argv[1], 0, PAXBUF_READ, DEFAULT_BLOCKING_FACTOR); - + rc = paxbuf_open (pbuf); printf ("Open: %d\n", rc); if (rc) -- cgit v1.2.1