代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/tar 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 9d1993f651d72f78b2afe416c72b1aeb0c1215ab Mon Sep 17 00:00:00 2001
From: Sergey Poznyakoff <gray@gnu.org>
Date: Fri, 28 Dec 2018 17:49:08 +0200
Subject: [PATCH 41/58] 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 | 12 ++++++++++++
src/tar.c | 27 +++++++++++++++++++++++++--
2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 66ed8ca..8e4207b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,6 +102,18 @@ gt_TYPE_SSIZE_T
# gnulib modules
gl_INIT
+
+if test $ac_cv_lib_error_at_line = no; then
+ # This means that the error() function is not present in libc, so
+ # the one from gnulib will be used instead. This function precedes
+ # error messages it prints with the program name as returned by getprogname()
+ # call, instead of using the name set by set_program_name.
+ # Install workaround.
+ AC_DEFINE([ENABLE_ERROR_PRINT_PROGNAME],[1],
+ [Enable the use of error_print_progname to print program name with error messages.
+ See comment to function tar_print_progname in src/tar.c])
+fi
+
# paxutils modules
tar_PAXUTILS
diff --git a/src/tar.c b/src/tar.c
index 9c939f3..721d777 100644
--- a/src/tar.c
+++ b/src/tar.c
@@ -2666,7 +2666,28 @@ decode_options (int argc, char **argv)
report_textual_dates (&args);
}
-
+
+#ifdef ENABLE_ERROR_PRINT_PROGNAME
+/* 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.
+
+ To avoid this, on such systems the following helper function is used
+ to print proper program name. Its address is assigned to the
+ error_print_progname variable, which error() then uses instead of
+ printing getprogname() result.
+ */
+static void
+tar_print_progname (void)
+{
+ fprintf (stderr, "%s: ", program_name);
+}
+#endif
/* Tar proper. */
@@ -2676,7 +2697,9 @@ main (int argc, char **argv)
{
set_start_time ();
set_program_name (argv[0]);
-
+#ifdef ENABLE_ERROR_PRINT_PROGNAME
+ error_print_progname = tar_print_progname;
+#endif
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。