update code

This commit is contained in:
zhuchunyi 2019-11-06 19:32:48 +08:00
parent 3276ac576a
commit c4004681ad
5 changed files with 19 additions and 48 deletions

View File

@ -1,29 +0,0 @@
From f2193587e8e51aa42b192c17ad39467931e2d4c2 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 19 Sep 2018 09:51:43 +0200
Subject: [PATCH] Fix segfault on arm machines
Some ARM cpus does not report the cache size or say it is -1 in sysfs.
It has been observed on xgene and thunderx machines.
Fall back to the generic cache size when that happens so we don't
segfault.
Should fix https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866306
---
src/havegetune.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/havegetune.c b/src/havegetune.c
index f1a99f2..de39c53 100644
--- a/src/havegetune.c
+++ b/src/havegetune.c
@@ -795,6 +795,8 @@ static int vfs_configInfoCache(
ctype = vfs_configFile(pAnchor, path, vfs_configType);
strcpy(path+plen, "size");
size = vfs_configFile(pAnchor, path, vfs_configInt);
+ if (size == -1)
+ size = ctype == 'I' ? GENERIC_ICACHE : GENERIC_DCACHE;
cfg_cacheAdd(pAnchor, SRC_VFS_INDEX, pArgs[1], level, ctype, size);
}
}

View File

@ -1,7 +1,9 @@
From 9ab2ff6874db0182714d8c09dceda9ee22e177f8 Mon Sep 17 00:00:00 2001
From: zhangtianxing <zhangtianxing3@huawei.com>
Date: Fri, 6 Sep 2019 19:09:13 +0800
Subject: [PATCH] huawei fix the core file problem
Subject: [PATCH] fix the core file problem
Reason: fix the core file problem
Signed-off-by: zhangtianxing <zhangtianxing3@huawei.com>
---
@ -9,18 +11,18 @@ Signed-off-by: zhangtianxing <zhangtianxing3@huawei.com>
1 file changed, 2 insertions(+)
diff --git a/src/haveged.c b/src/haveged.c
index d629e17..7496f56 100644
index e061079..daf81c9 100644
--- a/src/haveged.c
+++ b/src/haveged.c
@@ -351,6 +351,7 @@ int main(int argc, char **argv)
else run_daemon(handle);
@@ -470,6 +470,7 @@ int main(int argc, char **argv)
else run_daemon(handle, path, argv);
#endif
havege_destroy(handle);
+ handle = NULL;
exit(0);
}
#ifndef NO_DAEMON
@@ -513,6 +514,7 @@ static void error_exit( /* RETURN: nothing */
@@ -706,6 +707,7 @@ void error_exit( /* RETURN: nothing */
}
}
havege_destroy(handle);
@ -29,4 +31,5 @@ index d629e17..7496f56 100644
}
/**
--
1.8.3.1
2.19.1

Binary file not shown.

BIN
haveged-1.9.8.tar.gz Normal file

Binary file not shown.

View File

@ -2,15 +2,13 @@
# and made some modifications. The exactly file path is ./contrib/build/fedora.spec.
Summary: A Linux entropy source using the HAVEGE algorithm
Name: haveged
Version: 1.9.1
Release: 3
Version: 1.9.8
Release: 1
License: GPLv3+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
URL: http://www.irisa.fr/caps/projects/hipsor/
Source0: http://www.issihosts.com/haveged/%{name}-%{version}.tar.gz
URL: https://github.com/jirka-h/haveged
Source0: https://github.com/jirka-h/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: haveged.service
Patch6000: bugfix-cpu-cache-size-detection.patch
Patch9000: fix-the-core-file-problem.patch
Requires(post): systemd
@ -42,17 +40,13 @@ Requires: %{name} = %{version}-%{release}
%description devel
Headers and shared object symbolic links for the HAVEGE algorithm
%package help
Summary: Help information for user.
%description help
Help information for user.
%package_help
%prep
%setup -q
%build
%configure --enable-olt=no
%configure
make
%check
@ -71,7 +65,7 @@ mkdir -p .%{_unitdir}
install -p -m644 %{SOURCE1} .%{_unitdir}/haveged.service
popd
rm -rf %{buildroot}%{_libdir}/libhavege.*a
%delete_la_and_a
%clean
rm -rf %{buildroot}
@ -107,6 +101,9 @@ rm -rf %{buildroot}
%{_mandir}/man3/libhavege.3*
%changelog
* Mon Oct 14 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.9.8-1
- update to 1.9.8-1
* Fri Sep 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.9.1-3
- fix the core file problem