!12 [sync] PR-9: 添加sw架构

From: @openeuler-sync-bot 
Reviewed-by: @zengwefeng 
Signed-off-by: @zengwefeng
This commit is contained in:
openeuler-ci-bot 2022-12-15 08:07:44 +00:00 committed by Gitee
commit 0e097580d6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,35 @@
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

View File

@ -1,7 +1,7 @@
Name: iptraf-ng
Summary: A console-based network monitoring utility
Version: 1.2.1
Release: 2
Release: 3
License: GPLv2+
URL: https://github.com/%{name}/%{name}/
Source0: https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz
@ -11,6 +11,7 @@ Source2: %{name}-tmpfiles.conf
Patch0: backport-use-correct-format-specifier-for-time_t-type.patch
Patch1: backport-use-correct-format-specifier-when-printing-packet-count.patch
Patch2: backport-use-correct-format-specifier-for-table-entcount-variable.patch
Patch3: iptraf-ng-Add-sw64-architecture.patch
BuildRequires: gcc ncurses-devel
Obsoletes: iptraf < 3.1
@ -74,6 +75,12 @@ install -d -m 0755 %{buildroot}/run/%{name}/
%{_mandir}/man8/*.8.gz
%changelog
* Fri Oct 21 2022 wuzx<wuzx1226@qq.com> - 1.2.1-3
- Type:feature
- CVE:NA
- SUG:NA
- DESC:Add sw64 architecture
* Thu Oct 20 2022 yanglu <yanglu72@h-partners.com> - 1.2.1-2
- Type:bugfix
- Id:NA