Fix build error 33/291933/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 25 Apr 2023 07:45:01 +0000 (16:45 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 25 Apr 2023 07:46:07 +0000 (16:46 +0900)
Add time.h to Random.cc

[  307s] /home/abuild/rpmbuild/BUILD/libzypp-17.23.7/zypp/base/Random.cc: In function 'int zypp::base::random_int()':
[  307s] /home/abuild/rpmbuild/BUILD/libzypp-17.23.7/zypp/base/Random.cc:21:27: error: 'time' was not declared in this scope
[  307s]    21 |             seed = rand()+time(0);

Change-Id: I76fca0e0914f0638244818d227184ee1110fe72e

packaging/add_time_header_to_random.patch [new file with mode: 0644]
packaging/libzypp.spec

diff --git a/packaging/add_time_header_to_random.patch b/packaging/add_time_header_to_random.patch
new file mode 100644 (file)
index 0000000..6cc971a
--- /dev/null
@@ -0,0 +1,11 @@
+diff --git a/zypp/base/Random.cc b/zypp/base/Random.cc
+index c5dba8083..9f40a3871 100644
+--- a/zypp/base/Random.cc
++++ b/zypp/base/Random.cc
+@@ -1,5 +1,6 @@
+ #include <fcntl.h>
+ #include <unistd.h>
++#include <time.h>
+ #include <zypp/base/Random.h>
index dfeabfe..5b37feb 100644 (file)
@@ -9,6 +9,7 @@ Source1:        %{name}-rpmlintrc
 Source10:       Exclude_subdirectory.patch
 Source11:       add_pie_compile_option.patch
 Source12:       fix_swig_syntax_error.patch
+Source13:       add_time_header_to_random.patch
 Source1001:    libzypp.manifest
 
 # Features we provide (update doc/autoinclude/FeatureTest.doc):
@@ -109,6 +110,7 @@ cp %{SOURCE1001} .
 %{__patch} -p1 < %{SOURCE10}
 %{__patch} -p1 < %{SOURCE11}
 %{__patch} -p1 < %{SOURCE12}
+%{__patch} -p1 < %{SOURCE13}
 
 %build
 mkdir build