When an errno other than EINVAL, ENOTTY or EPERM is returned from FIBMAP ioctl, the negative errno is passsed to strerror(), which only accepts positive errno values. Signed-off-by: David Timber --- misc/filefrag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/filefrag.c b/misc/filefrag.c index 4641714c..d45288cd 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -517,7 +517,7 @@ static int frag_report(const char *filename) filename); } else { fprintf(stderr, "%s: FIBMAP error: %s", - filename, strerror(expected)); + filename, strerror(-expected)); } rc = expected; goto out_close; -- 2.53.0.1.ga224b40d3f.dirty