~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only link the server against Catacomb.
[tripe]
/
tun-unet.c
diff --git
a/tun-unet.c
b/tun-unet.c
index
d78c9a1
..
cc1e407
100644
(file)
--- a/
tun-unet.c
+++ b/
tun-unet.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: tun-unet.c,v 1.
1 2001/02/03 20:26:37
mdw Exp $
+ * $Id: tun-unet.c,v 1.
3 2001/02/05 19:55:00
mdw Exp $
*
* Tunnel interface based on Linux Usernet
*
*
* Tunnel interface based on Linux Usernet
*
@@
-29,6
+29,12
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: tun-unet.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: tun-unet.c,v $
+ * Revision 1.3 2001/02/05 19:55:00 mdw
+ * Guard against inappropriate compilation.
+ *
+ * Revision 1.2 2001/02/04 17:10:58 mdw
+ * Make file descriptors be nonblocking and close-on-exec.
+ *
* Revision 1.1 2001/02/03 20:26:37 mdw
* Initial checkin.
*
* Revision 1.1 2001/02/03 20:26:37 mdw
* Initial checkin.
*
@@
-43,6
+49,10
@@
/*----- Main code ---------------------------------------------------------*/
/*----- Main code ---------------------------------------------------------*/
+#if TUN_TYPE != TUN_UNET
+# error "Tunnel type mismatch: fix the Makefile"
+#endif
+
/* --- @t_read@ --- *
*
* Arguments: @int fd@ = file descriptor to read
/* --- @t_read@ --- *
*
* Arguments: @int fd@ = file descriptor to read
@@
-106,6
+116,7
@@
int tun_create(tunnel *t, peer *p)
a_warn("open `/dev/unet' failed: %s", strerror(errno));
return (-1);
}
a_warn("open `/dev/unet' failed: %s", strerror(errno));
return (-1);
}
+ fdflags(fd, O_NONBLOCK, O_NONBLOCK, FD_CLOEXEC, FD_CLOEXEC);
t->p = p;
sel_initfile(&sel, &t->f, fd, SEL_READ, t_read, t);
sel_addfile(&t->f);
t->p = p;
sel_initfile(&sel, &t->f, fd, SEL_READ, t_read, t);
sel_addfile(&t->f);