Adding a patch from upstream fixing a simple formatting bug on gcc-9

This commit is contained in:
Ingvar Hagelund 2019-02-14 13:02:18 +01:00
parent a0e516d27c
commit 14c11acbc3
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,39 @@
commit 7119d790b590e7fb560ad602cedfda5185c7e841
Author: Poul-Henning Kamp <phk@FreeBSD.org>
Date: Fri Jan 11 10:26:44 2019 +0000
Avoid printing %s,NULL in case of errors we do not expect.
Fixes #2879
diff --git a/lib/libvarnish/vnum.c b/lib/libvarnish/vnum.c
index b619199c6..59e804ec8 100644
--- a/lib/libvarnish/vnum.c
+++ b/lib/libvarnish/vnum.c
@@ -349,15 +349,17 @@ main(int argc, char *argv[])
for (tc = test_cases; tc->str; ++tc) {
e = VNUM_2bytes(tc->str, &val, tc->rel);
- if (e != tc->err) {
- printf("%s: VNUM_2bytes(\"%s\", %ju) (%s) != (%s)\n",
- *argv, tc->str, tc->rel, tc->err, e);
- ++ec;
- } else if (e == NULL && val != tc->val) {
- printf("%s: VNUM_2bytes(\"%s\", %ju) %ju != %ju (%s)\n",
- *argv, tc->str, tc->rel, val, tc->val, e);
- ++ec;
- }
+ if (e != NULL)
+ val = 0;
+ if (e == tc->err && val == tc->val)
+ continue;
+ ++ec;
+ printf("%s: VNUM_2bytes(\"%s\", %ju)\n",
+ *argv, tc->str, tc->rel);
+ printf("\tExpected:\tstatus %s - value %ju\n",
+ tc->err ? tc->err : "Success", tc->val);
+ printf("\tGot:\t\tstatus %s - value %ju\n",
+ e ? e : "Success", val);
}
if (!isnan(VNUM_duration(NULL))) {
printf("%s: VNUM_Duration(NULL) fail\n", *argv);

View File

@ -21,7 +21,7 @@
Summary: High-performance HTTP accelerator Summary: High-performance HTTP accelerator
Name: varnish Name: varnish
Version: 6.1.1 Version: 6.1.1
Release: 3%{?dist} Release: 4%{?dist}
License: BSD License: BSD
URL: https://www.varnish-cache.org/ URL: https://www.varnish-cache.org/
Source0: http://varnish-cache.org/_downloads/%{name}-%{version}%{?vd_rc}.tgz Source0: http://varnish-cache.org/_downloads/%{name}-%{version}%{?vd_rc}.tgz
@ -36,6 +36,9 @@ Patch12: varnish-6.0.1_fix_bug2668.patch
# Just a simple formatting error # Just a simple formatting error
Patch13: varnish-6.1.0_fix_testu00008.patch Patch13: varnish-6.1.0_fix_testu00008.patch
# Another formatting error fixed upstream
Patch14: varnish-6.1.1_fix_upstrbug_2879.patch
%if 0%{?fedora} > 29 %if 0%{?fedora} > 29
Provides: varnish%{_isa} = %{version}-%{release} Provides: varnish%{_isa} = %{version}-%{release}
Provides: varnishd(abi)%{_isa} = %{abi} Provides: varnishd(abi)%{_isa} = %{abi}
@ -156,6 +159,7 @@ sed -i '8 i\RPM_BUILD_ROOT=%{buildroot}' find-provides
%endif %endif
#patch12 -p1 #patch12 -p1
%patch13 -p0 %patch13 -p0
%patch14 -p1
%build %build
%if 0%{?rhel} == 6 %if 0%{?rhel} == 6
@ -396,6 +400,9 @@ fi
%changelog %changelog
* Thu Feb 14 2019 Ingvar Hagelund <ingvar@redpill-linpro.com> - 6.1.1-4
- Adding a patch from upstream fixing a simple formatting bug on gcc-9
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.1-3 * Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild