projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de71926
)
Correct calculation of max_fd after fd_del().
author
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 9 Jan 2005 21:28:49 +0000
(21:28 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 9 Jan 2005 21:28:49 +0000
(21:28 +0000)
fd/fd.c
patch
|
blob
|
history
diff --git
a/fd/fd.c
b/fd/fd.c
index
ad4a8ca
..
e658c1d
100644
(file)
--- a/
fd/fd.c
+++ b/
fd/fd.c
@@
-79,10
+79,14
@@
bool fd_del(struct fd *fd) {
FD_CLR(fd->fd, &writeset);
FD_CLR(fd->fd, &errorset);
- if(fd->fd >= max_fd)
- max_fd = ((struct fd *)fds->tail)->fd;
+ avl_del(fds, fd);
- return avl_del(fds, fd);
+ if(fds->tail)
+ max_fd = ((struct fd *)fds->tail->data)->fd;
+ else
+ max_fd = 0;
+
+ return true;
};
bool fd_mod(struct fd *fd) {