From: Xiao Yang Date: Thu, 17 May 2018 03:32:27 +0000 (+0800) Subject: generic/486: Get rid of the redundant error=%d printing X-Git-Tag: v2022.05.01~1553 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=287b2e05b52789299dfddf56aec796e92de366e1 generic/486: Get rid of the redundant error=%d printing 1) Without the fix, perror() can indicate the actual error(ENODATA). 2) After calling perror() and redirecting the output of perror() to a file, errno seems to be set to EINVAL unexpectedly. See the following mail for detailed info: https://www.spinics.net/lists/fstests/msg09675.html Signed-off-by: Xiao Yang Reviewed-by: Darrick J. Wong Signed-off-by: Eryu Guan --- diff --git a/src/attr_replace_test.c b/src/attr_replace_test.c index 23adc072..0720bfdc 100644 --- a/src/attr_replace_test.c +++ b/src/attr_replace_test.c @@ -11,7 +11,7 @@ #include #define die() do { perror(""); \ -fprintf(stderr, "error=%d at line %d\n", errno, __LINE__); \ +fprintf(stderr, "error at line %d\n", __LINE__); \ exit(1); } while (0) #define fail(...) do { \