]> git.ipfire.org Git - thirdparty/tar.git/commit
Work over a bug in gnulib error()
authorSergey Poznyakoff <gray@gnu.org>
Fri, 28 Dec 2018 15:49:08 +0000 (17:49 +0200)
committerSergey Poznyakoff <gray@gnu.org>
Fri, 28 Dec 2018 15:49:08 +0000 (17:49 +0200)
commit9d1993f651d72f78b2afe416c72b1aeb0c1215ab
treee279b8f59e52162690ab8daf606b00debd0f1c3c
parente7cd377f7801d42aa8e07addff93d2150666c237
Work over a bug in gnulib error()

The error() function from glibc correctly prefixes each message it
prints with program_name as set by set_program_name. However, its
replacement from gnulib, which is linked in on systems where this
function is not available, prints the name returned by getprogname()
instead. Due to this messages output by tar subprocess (which sets its
program name to 'tar (child)') become indiscernible from those printed
by the main process. In particular, this breaks the remfiles01.at and
remfiles02.at test cases.

* configure.ac: Define ENABLE_ERROR_PRINT_PROGNAME if using
gnulib error().
* src/tar.c [ENABLE_ERROR_PRINT_PROGNAME] (tar_print_progname): New function.
(main) [ENABLE_ERROR_PRINT_PROGNAME]: Set error_print_progname.
configure.ac
src/tar.c