From 806a6bf34fcfcdbdeb17a7bdefae61f274cadc38 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 11 Sep 2020 10:51:27 +0200 Subject: [PATCH] Replace fatal g_error() with g_debug() --- src/virt_cacard.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/virt_cacard.c b/src/virt_cacard.c index d8c2b3a..0be29ab 100644 --- a/src/virt_cacard.c +++ b/src/virt_cacard.c @@ -209,12 +209,14 @@ static gboolean do_socket_send(GIOChannel *source, GIOCondition condition, gpoin g_return_val_if_fail(socket_to_send->len != 0, FALSE); g_return_val_if_fail(condition & G_IO_OUT, FALSE); - if (condition & G_IO_HUP) - g_error ("Write end of pipe died!\n"); + if (condition & G_IO_HUP) { + g_debug("Write end of pipe died!\n"); + return FALSE + } g_io_channel_write_chars(channel_socket, (gchar *)socket_to_send->data, socket_to_send->len, &bw, &error); if (error != NULL) { - g_error("Error while sending socket %s", error->message); + g_debug("Error while sending socket %s", error->message); return FALSE; } g_byte_array_remove_range(socket_to_send, 0, bw); @@ -387,12 +389,12 @@ static gboolean do_socket_read(GIOChannel *source, GIOCondition condition, gpoin static gboolean poweredOff = FALSE; if (condition & G_IO_HUP) { - g_error ("Write end of pipe died!\n"); + g_debug("Write end of pipe died!\n"); return FALSE; } g_io_channel_read_chars(source,(gchar *) buffer, toRead, &wasRead, &error); if (error != NULL){ - g_error("error while reading: %s", error->message); + g_debug("error while reading: %s", error->message); free(buffer); return FALSE; } @@ -450,7 +452,7 @@ static gboolean do_socket_read(GIOChannel *source, GIOCondition condition, gpoin } g_io_channel_flush(channel_socket, &error); if(error != NULL){ - g_error("Error while flushing: %s", error->message); + g_debug("Error while flushing: %s", error->message); } free(buffer); return isOk;