Skip to content

Commit 806a6bf

Browse files
committed
Replace fatal g_error() with g_debug()
1 parent 60d3ae3 commit 806a6bf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/virt_cacard.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,14 @@ static gboolean do_socket_send(GIOChannel *source, GIOCondition condition, gpoin
209209

210210
g_return_val_if_fail(socket_to_send->len != 0, FALSE);
211211
g_return_val_if_fail(condition & G_IO_OUT, FALSE);
212-
if (condition & G_IO_HUP)
213-
g_error ("Write end of pipe died!\n");
212+
if (condition & G_IO_HUP) {
213+
g_debug("Write end of pipe died!\n");
214+
return FALSE
215+
}
214216

215217
g_io_channel_write_chars(channel_socket, (gchar *)socket_to_send->data, socket_to_send->len, &bw, &error);
216218
if (error != NULL) {
217-
g_error("Error while sending socket %s", error->message);
219+
g_debug("Error while sending socket %s", error->message);
218220
return FALSE;
219221
}
220222
g_byte_array_remove_range(socket_to_send, 0, bw);
@@ -387,12 +389,12 @@ static gboolean do_socket_read(GIOChannel *source, GIOCondition condition, gpoin
387389
static gboolean poweredOff = FALSE;
388390

389391
if (condition & G_IO_HUP) {
390-
g_error ("Write end of pipe died!\n");
392+
g_debug("Write end of pipe died!\n");
391393
return FALSE;
392394
}
393395
g_io_channel_read_chars(source,(gchar *) buffer, toRead, &wasRead, &error);
394396
if (error != NULL){
395-
g_error("error while reading: %s", error->message);
397+
g_debug("error while reading: %s", error->message);
396398
free(buffer);
397399
return FALSE;
398400
}
@@ -450,7 +452,7 @@ static gboolean do_socket_read(GIOChannel *source, GIOCondition condition, gpoin
450452
}
451453
g_io_channel_flush(channel_socket, &error);
452454
if(error != NULL){
453-
g_error("Error while flushing: %s", error->message);
455+
g_debug("Error while flushing: %s", error->message);
454456
}
455457
free(buffer);
456458
return isOk;

0 commit comments

Comments
 (0)