diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-02-27 14:20:46 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-02-27 15:32:44 -0800 |
commit | 27068d3308ab3554909e62ffdd1ac5f27249217b (patch) | |
tree | 5a409efd9df9e85da73cf1df24aa7b270bfc9b98 | |
parent | cfe6c01896e9606f321e62f77be0b922be419999 (diff) | |
download | paxutils-27068d3308ab3554909e62ffdd1ac5f27249217b.tar.gz |
paxtest: fix link issue and pacify GCC 10
* paxtest/paxtest.c (xalloc_die): Call exit explicitly,
to pacify GCC 10.
(fatal_exit): New function; otherwise paxtest doesn’t link.
-rw-r--r-- | paxtest/paxtest.c | 16 |
1 files 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) |