about summary refs log tree commit diff
path: root/Src/Modules/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Modules/socket.c')
-rw-r--r--Src/Modules/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Modules/socket.c b/Src/Modules/socket.c
index 92d0a5035..65b87d7dd 100644
--- a/Src/Modules/socket.c
+++ b/Src/Modules/socket.c
@@ -193,7 +193,7 @@ bin_zsocket(char *nam, char **args, Options ops, UNUSED(int func))
 	len = sizeof(soun);
 	do {
 	    rfd = accept(lfd, (struct sockaddr *)&soun, &len);
-	} while (errno == EINTR && !errflag);
+	} while (rfd < 0 && errno == EINTR && !errflag);
 
 	if (rfd == -1) {
 	    zwarnnam(nam, "could not accept connection: %e", errno);