generic/486: Get rid of the redundant error=%d printing
authorXiao Yang <yangx.jy@cn.fujitsu.com>
Thu, 17 May 2018 03:32:27 +0000 (11:32 +0800)
committerEryu Guan <guaneryu@gmail.com>
Fri, 18 May 2018 06:31:20 +0000 (14:31 +0800)
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 <yangx.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/attr_replace_test.c

index 23adc072e5c17af8ae47b59dc3a0776916d5779a..0720bfdc18ab61749ccf663914f894eda0f1fd0c 100644 (file)
@@ -11,7 +11,7 @@
 #include <sys/stat.h>
 
 #define die() do { perror(""); \
 #include <sys/stat.h>
 
 #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 { \
 exit(1); } while (0)
 
 #define fail(...) do { \