Allow set_driver to fail and handle this case.
[cascardo/rnetproxy.git] / hcconn.c
index 02f1572..0ba378a 100644 (file)
--- a/hcconn.c
+++ b/hcconn.c
@@ -132,7 +132,7 @@ hc_conn_watch (GIOChannel *channel, GIOCondition cond, gpointer data)
   return TRUE;
 }
 
-void
+int
 hc_conn_set_driver_channel (HCConn *conn, int fd)
 {
   struct channel_layer *layer = g_slice_new (struct channel_layer);
@@ -148,6 +148,7 @@ hc_conn_set_driver_channel (HCConn *conn, int fd)
   if (conn->func)
     conn->func (conn, HC_EVENT_CONNECT, conn->data);
   fcntl (fd, F_SETFL, fcntl (fd, F_GETFL, 0) | O_NONBLOCK);
+  return 0;
 }