summaryrefslogtreecommitdiffstats
path: root/security/seahorse/files/patch-agent_seahorse-agent-io.c
blob: 73f68960ed3fd20fa7d043bbbc354c53e39322ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- agent/seahorse-agent-io.c.orig  Fri Jan 28 15:52:18 2005
+++ agent/seahorse-agent-io.c   Fri Jan 28 15:54:19 2005
@@ -377,12 +377,18 @@
     gsize length;
     GError *err = NULL;
     gboolean ret = TRUE;
+    GIOStatus status;
 
     if (condition & G_IO_IN) {
         /* Read 1 line from the io channel, including newline character */
-        g_io_channel_read_line (source, &string, &length, NULL, &err);
+        status = g_io_channel_read_line (source, &string, &length, NULL, &err);
 
-        if (err != NULL) {
+   if (status == G_IO_STATUS_EOF) {
+       free_conn (cn);
+       ret = FALSE;
+   }
+
+   else if (err != NULL) {
             g_critical ("couldn't read from socket: %s", err->message);
             g_clear_error (&err);
             free_conn (cn);
@@ -398,7 +404,7 @@
             g_free (string);
     }
 
-    if (condition & G_IO_HUP) {
+    else if (condition & G_IO_HUP) {
         free_conn (cn);
         ret = FALSE;            /* removes watch */
     }