Signed-off-by: wzx <wuzx1226@qq.com> (cherry picked from commit 519df5b4b13f523079402f7a948eb2212e3552ec)
36 lines
874 B
Diff
Executable File
36 lines
874 B
Diff
Executable File
From b79f6837f0ac885736b5677887e760dd85954d99 Mon Sep 17 00:00:00 2001
|
|
From: wxy <xywang7443@stu.jiangna.edu.cn>
|
|
Date: Sat, 22 Oct 2022 09:16:10 +0800
|
|
Subject: [PATCH] Add sw64 architecture
|
|
|
|
Signed-off-by: wxy <xywang7443@stu.jiangna.edu.cn>
|
|
---
|
|
src/capt.c | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
diff --git a/src/capt.c b/src/capt.c
|
|
index 324d7cc..5554ef1 100644
|
|
--- a/src/capt.c
|
|
+++ b/src/capt.c
|
|
@@ -42,10 +42,17 @@ static int capt_set_recv_timeout(int fd, unsigned int msec)
|
|
|
|
timeout.tv_sec = msec / 1000;
|
|
timeout.tv_usec = (msec % 1000) * 1000;
|
|
+#ifdef __sw_64__
|
|
+ if(setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO_OLD, &timeout, len) != 0)
|
|
+ return -1;
|
|
+ else
|
|
+ return 0;
|
|
+#else
|
|
if(setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, len) != 0)
|
|
return -1;
|
|
else
|
|
return 0;
|
|
+#endif
|
|
}
|
|
|
|
static int capt_setup_receive_function(struct capt *capt)
|
|
--
|
|
2.33.0
|
|
|