]> git.proxmox.com Git - qemu.git/commitdiff
qemu-io: Fix error messages
authorKevin Wolf <kwolf@redhat.com>
Fri, 28 May 2010 18:10:48 +0000 (20:10 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 4 Jun 2010 09:43:39 +0000 (11:43 +0200)
The truncate and getlength commands passed a negative error number to strerror.
They also happen to be the two functions that are lacking a newline at the end
of their error message.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-io.c

index 72a45247da73db355b9f7030133eda48c9163967..7c6120b6acc5c3cd88f8371bc8d3a337922f49aa 100644 (file)
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -1317,7 +1317,7 @@ truncate_f(int argc, char **argv)
 
        ret = bdrv_truncate(bs, offset);
        if (ret < 0) {
-               printf("truncate: %s", strerror(ret));
+               printf("truncate: %s\n", strerror(-ret));
                return 0;
        }
 
@@ -1342,7 +1342,7 @@ length_f(int argc, char **argv)
 
        size = bdrv_getlength(bs);
        if (size < 0) {
-               printf("getlength: %s", strerror(size));
+               printf("getlength: %s\n", strerror(-size));
                return 0;
        }