Check for failure when trying to bind.
[cascardo/f2fchat.git] / f2fchat.c
index 634133c..5462e6a 100644 (file)
--- a/f2fchat.c
+++ b/f2fchat.c
@@ -18,6 +18,7 @@
 
 #include "friend.h"
 #include <glib.h>
+#include <stdio.h>
 
 static gboolean quit(gpointer data)
 {
@@ -31,7 +32,10 @@ int main(int argc, char **argv)
        struct cache *cache;
        GMainLoop *loop;
        g_type_init();
-       sock_init();
+       if (sock_init()) {
+               fprintf(stderr, "Error creating socket.\n");
+               return 1;
+       }
        create_cache(&cache);
        load_cache(cache, "friends.cache");
        loop = g_main_loop_new(g_main_context_default(), TRUE);