30 lines
982 B
Diff
30 lines
982 B
Diff
|
From 9938d82cc9cc5ae82283bea7a24ff45d08690e27 Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
|
||
|
Date: Thu, 17 Apr 2014 19:21:12 +0200
|
||
|
Subject: [PATCH] qtest: Be paranoid about accept() addrlen argument
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
If EINTR occurs, re-initialize our argument.
|
||
|
|
||
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
||
|
---
|
||
|
tests/libqtest.c | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/tests/libqtest.c b/tests/libqtest.c
|
||
|
index 18efcf2..1eb9db6 100644
|
||
|
--- a/tests/libqtest.c
|
||
|
+++ b/tests/libqtest.c
|
||
|
@@ -89,8 +89,8 @@ static int socket_accept(int sock)
|
||
|
setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (void *)&timeout,
|
||
|
sizeof(timeout));
|
||
|
|
||
|
- addrlen = sizeof(addr);
|
||
|
do {
|
||
|
+ addrlen = sizeof(addr);
|
||
|
ret = accept(sock, (struct sockaddr *)&addr, &addrlen);
|
||
|
} while (ret == -1 && errno == EINTR);
|
||
|
if (ret == -1) {
|