From ecef1708a56f28be38cae1076b4e357174d138b8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 25 Sep 2017 19:25:20 +0100 Subject: [PATCH] diff: Remove bogus perror when guestfs_* functions return error. Neither guestfs_copy_statns nor guestfs_copy_xattr_list set errno, so it's wrong to call perror(3) here. --- diff/diff.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/diff/diff.c b/diff/diff.c index 36ac0d24d..ed02f84b7 100644 --- a/diff/diff.c +++ b/diff/diff.c @@ -485,15 +485,11 @@ visit_entry (const char *dir, const char *name, * free them after we return. */ stat = guestfs_copy_statns (stat_orig); - if (stat == NULL) { - perror ("guestfs_copy_stat"); + if (stat == NULL) goto error; - } xattrs = guestfs_copy_xattr_list (xattrs_orig); - if (xattrs == NULL) { - perror ("guestfs_copy_xattr_list"); + if (xattrs == NULL) goto error; - } if (checksum && is_reg (stat->st_mode)) { csum = guestfs_checksum (t->g, checksum, path);