From: Eric Sandeen Date: Wed, 6 Nov 2013 23:15:50 +0000 (-0600) Subject: btrfs-progs: pass positive errno to strerror in cmd_df() X-Git-Tag: upstream/4.16.1~3044 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e29db9e49f1bb23789f2fa34d0ae2e5608dc551;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: pass positive errno to strerror in cmd_df() get_df returns a negative error number, but then we pass it to strerror, which wants a positive value... Resolves-Coverity-CID: 1125929 Signed-off-by: Eric Sandeen Signed-off-by: Chris Mason --- diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 376037b..b4727c2 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -173,7 +173,7 @@ static int cmd_df(int argc, char **argv) print_df(sargs); free(sargs); } else { - fprintf(stderr, "ERROR: get_df failed %s\n", strerror(ret)); + fprintf(stderr, "ERROR: get_df failed %s\n", strerror(-ret)); } close_file_or_dir(fd, dirstream);