]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fadvise: correctly report error from posix_fadvise
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 16 Apr 2023 08:52:28 +0000 (10:52 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 16 Apr 2023 16:43:12 +0000 (18:43 +0200)
posix_fadvise() does not use errno.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
misc-utils/fadvise.c

index c6c8eaf1fd0fffbc0b7c22d97d82306be859cdcd..b16d036c0368b48f8266f55092a77436b6a3ab4f 100644 (file)
@@ -153,7 +153,7 @@ int main(int argc, char ** argv)
                           offset, len,
                           advice);
        if (rc != 0)
-               warn(_("failed to advise"));
+               warnx(_("failed to advise: %s"), strerror(rc));
 
        if (do_close)
                close(fd);