Fix stupid bugs from the listen(2) change.
authormdw <mdw>
Sat, 23 Feb 2002 00:08:00 +0000 (00:08 +0000)
committermdw <mdw>
Sat, 23 Feb 2002 00:08:00 +0000 (00:08 +0000)
socket.c

index 60d3d84..87b3d96 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: socket.c,v 1.8 2002/02/22 23:44:44 mdw Exp $
+ * $Id: socket.c,v 1.9 2002/02/23 00:08:00 mdw Exp $
  *
  * Socket source and target definitions
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: socket.c,v $
+ * Revision 1.9  2002/02/23 00:08:00  mdw
+ * Fix stupid bugs from the listen(2) change.
+ *
  * Revision 1.8  2002/02/22 23:44:44  mdw
  * Call @xfree@ rather than @free@.  Add option to change the listen(2)
  * parameter.
@@ -351,6 +354,7 @@ static int ssource_option(source *s, scanner *sc)
     sso->listen = atoi(sc->d.buf);
     if (sso->listen == 0)
       error(sc, "argument of `listen' must be positive");
+    token(sc);
     CONF_ACCEPT;
   }
 
@@ -607,7 +611,7 @@ static void ssource_attach(source *s, scanner *sc, target *t)
 
     /* --- Set it to listen for connections --- */
 
-    if (listen(fd, 5))
+    if (listen(fd, ss->o.listen))
       error(sc, "couldn't listen on socket: %s", strerror(errno));
   }