From 7e3f74531316d71a994c6b31fc294b3a55424afb Mon Sep 17 00:00:00 2001 Message-Id: <7e3f74531316d71a994c6b31fc294b3a55424afb.1367947969.git.minovotn@redhat.com> In-Reply-To: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> References: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> From: Michal Novotny Date: Tue, 7 May 2013 18:37:11 +0200 Subject: [PATCH 026/114] Revert "qemu-ga: Handle errors uniformely in ga_channel_open()" This reverts commit 0a3ea6ac5e1551494d4782687fa7d9b27f57db15. Reverting as asked by Laszlo in message <51892739.2030807@redhat.com> because of the ordering issue (most likely) related to supersed testing. Signed-off-by: Michal Novotny --- qga/channel-posix.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/qga/channel-posix.c b/qga/channel-posix.c index ad574d2..53dc044 100644 --- a/qga/channel-posix.c +++ b/qga/channel-posix.c @@ -141,15 +141,14 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, GAChannelMethod ); if (fd == -1) { g_critical("error opening channel: %s", strerror(errno)); - return false; + exit(EXIT_FAILURE); } #ifdef CONFIG_SOLARIS ret = ioctl(fd, I_SETSIG, S_OUTPUT | S_INPUT | S_HIPRI); if (ret == -1) { g_critical("error setting event mask for channel: %s", strerror(errno)); - close(fd); - return false; + exit(EXIT_FAILURE); } #endif ret = ga_channel_client_add(c, fd); @@ -165,7 +164,7 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, GAChannelMethod int fd = qemu_open(path, O_RDWR | O_NOCTTY | O_NONBLOCK); if (fd == -1) { g_critical("error opening channel: %s", strerror(errno)); - return false; + exit(EXIT_FAILURE); } tcgetattr(fd, &tio); /* set up serial port for non-canonical, dumb byte streaming */ @@ -185,9 +184,7 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, GAChannelMethod tcsetattr(fd, TCSANOW, &tio); ret = ga_channel_client_add(c, fd); if (ret) { - g_critical("error adding channel to main loop"); - close(fd); - return false; + g_error("error adding channel to main loop"); } break; } -- 1.7.11.7