Provide a `--pidfile' option in `fw'.
[fwd] / endpt.c
diff --git a/endpt.c b/endpt.c
index 348dd44..173c1b9 100644 (file)
--- a/endpt.c
+++ b/endpt.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: endpt.c,v 1.1 1999/07/26 23:33:01 mdw Exp $
+ * $Id: endpt.c,v 1.4 2004/04/08 01:36:25 mdw Exp $
  *
  * Generic endpoint abstraction
  *
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: endpt.c,v $
- * Revision 1.1  1999/07/26 23:33:01  mdw
- * Infrastructure for the new design.
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #include "config.h"
@@ -47,6 +39,8 @@
 #include <unistd.h>
 #include <fcntl.h>
 
+#include <mLib/alloc.h>
+
 #include "chan.h"
 #include "endpt.h"
 
@@ -324,11 +318,14 @@ void endpt_join(endpt *a, endpt *b)
       e = a; a = b; b = e;
     }
 
-    /* --- Attach the non-file endpoint to the file and run away --- */
+    /* --- Attach the non-file endpoint to the file and run away --- *
+     *
+     * Leave it as the non-file's responsibility to close the other endpoint
+     * when it's ready.  It should also close itself at that time.
+     */
 
     b->ops->attach(b, a->in, a->out);
-    a->ops->close(a);
-    b->ops->close(b);
+    b->ops->file(b, a);
     if (t->next)
       t->next->prev = t->prev;
     if (t->prev)