server/: Make initialization errors be non-fatal and restartable.
[tripe] / server / tun-slip.c
index d4b35d0..29f42d5 100644 (file)
@@ -179,13 +179,13 @@ static void t_read(int fd, unsigned mode, void *v)
  *
  * Arguments:  ---
  *
- * Returns:    ---
+ * Returns:    Zero on success, @-1@ on failure.
  *
  * Use:                Initializes the tunneling system.  Maybe this will require
  *             opening file descriptors or something.
  */
 
-static void t_init(void)
+static int t_init(void)
 {
   char *p, *q;
   dstr d = DSTR_INIT;
@@ -194,7 +194,7 @@ static void t_init(void)
   size_t n;
 
   if ((p = getenv("TRIPE_SLIPIF")) == 0)
-    return;
+    return (0);
 
   /* --- Build the list of available interfaces --- */
 
@@ -240,10 +240,11 @@ static void t_init(void)
       break;
     p++;
   }
-  return;
+  return (0);
 
 whine:
   a_warn("TUN", "-", "slip", "bad-interface-list", A_END);
+  return (-1);
 }
 
 /* --- @t_broken@ --- *