Message ID | 1383779755-18228-12-git-send-email-sandeen@redhat.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Reviewed-by Anand Jain <anand.jain@oracle.com> On 11/07/2013 07:15 AM, Eric Sandeen wrote: > 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 <sandeen@redhat.com> > --- > cmds-filesystem.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/cmds-filesystem.c b/cmds-filesystem.c > index df9d1ff..b1291d6 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); > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/cmds-filesystem.c b/cmds-filesystem.c index df9d1ff..b1291d6 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);
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 <sandeen@redhat.com> --- cmds-filesystem.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)