Patchwork [v2,05/13] qemu-char: use more specific error_setg_* variants

login
register
mail settings
Submitter Gerd Hoffmann
Date June 24, 2013, 6:39 a.m.
Message ID <1372055996-4072-6-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/253640/
State New
Headers show

Comments

Gerd Hoffmann - June 24, 2013, 6:39 a.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 qemu-char.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/qemu-char.c b/qemu-char.c
index ee7c70e..cfc68cd 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2604,7 +2604,7 @@  static CharDriverState *qemu_chr_open_socket_fd(int fd, bool do_nodelay,
 
     memset(&ss, 0, ss_len);
     if (getsockname(fd, (struct sockaddr *) &ss, &ss_len) != 0) {
-        error_setg(errp, "getsockname: %s", strerror(errno));
+        error_setg_errno(errp, errno, "getsockname");
         return NULL;
     }
 
@@ -3536,7 +3536,7 @@  static int qmp_chardev_open_file_source(char *src, int flags,
 
     TFR(fd = qemu_open(src, flags, 0666));
     if (fd == -1) {
-        error_setg(errp, "open %s: %s", src, strerror(errno));
+        error_setg_file_open(errp, errno, src);
     }
     return fd;
 }