aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-01-02 21:53:34 +0000
committerHolger Freyther <zecke@selfish.org>2009-01-02 21:53:34 +0000
commitc6880a46adea65e5efd9dddb6dcd2cf5caa4966a (patch)
treeffe89c1f84a6e57f94b8d5d55c88ca2870fe78f6
parentb21b305d7ca834b2783bd3ad28e56d4a3435790c (diff)
Use the _safe variant as a bsc_unregister_fd might be called from within the callback
-rw-r--r--src/select.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c
index b5d22c5b8..959c42076 100644
--- a/src/select.c
+++ b/src/select.c
@@ -55,7 +55,7 @@ void bsc_unregister_fd(struct bsc_fd *fd)
int bsc_select_main()
{
- struct bsc_fd *ufd;
+ struct bsc_fd *ufd, *tmp;
fd_set readset, writeset, exceptset;
int i;
@@ -84,7 +84,7 @@ int bsc_select_main()
update_timers();
/* call registered callback functions */
- llist_for_each_entry(ufd, &bsc_fds, list) {
+ llist_for_each_entry_safe(ufd, tmp, &bsc_fds, list) {
int flags = 0;
if (FD_ISSET(ufd->fd, &readset))