From 34e642923538a05ac21d7e7495da23fb0da56c5f Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 26 Jan 2022 16:39:33 +0100 Subject: passt, tap: Daemonise once socket is ready without waiting for connection The existing behaviour is not really practical: an automated agent in charge of starting both qemu and passt would need to fork itself to start passt, because passt won't fork to background until qemu connects, and the agent needs to unblock to start qemu. Instead of waiting for a connection to daemonise, do it right away as soon as a socket is available: that can be considered an initialised state already. Signed-off-by: Stefano Brivio --- tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tcp.c') diff --git a/tcp.c b/tcp.c index 01f09e9..7122898 100644 --- a/tcp.c +++ b/tcp.c @@ -2319,7 +2319,7 @@ recvmsg: if (errno == EAGAIN || errno == EWOULDBLOCK) return 0; - tap_handler(c, EPOLLERR, now); + tap_handler(c, c->fd_tap, EPOLLERR, now); } i--; -- cgit v1.2.3