diff options
Diffstat (limited to 'lib/imsg.c')
| -rw-r--r-- | lib/imsg.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/imsg.c b/lib/imsg.c index 5424140720..935d137727 100644 --- a/lib/imsg.c +++ b/lib/imsg.c @@ -299,11 +299,10 @@ int imsg_get_fd(struct imsgbuf *ibuf) int fd; struct imsg_fd *ifd; - if ((ifd = TAILQ_FIRST(&ibuf->fds)) == NULL) + if ((ifd = TAILQ_POP_FIRST(&ibuf->fds, entry)) == NULL) return (-1); fd = ifd->fd; - TAILQ_REMOVE(&ibuf->fds, ifd, entry); free(ifd); return (fd); |
