!4 fix compile failed

Merge pull request !4 from 雷炬/master
This commit is contained in:
openeuler-ci-bot 2020-06-05 15:04:46 +08:00 committed by Gitee
commit ea33efab95
3 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 52f12fea424e62dc6b14aff69406eebe76bf2984 Mon Sep 17 00:00:00 2001
From: "Christopher N. Hesse" <raymanfx@gmail.com>
Date: Wed, 3 Apr 2019 22:23:06 +0200
Subject: [PATCH 1/2] utils: fileUtils: Fix null string
syncAndCloseFile() takes an error message string as second argument, so
do not pass NULL.
Signed-off-by: Christopher N. Hesse <raymanfx@gmail.com>
---
utils/uds/fileUtils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils/uds/fileUtils.c b/utils/uds/fileUtils.c
index d3f6e70..43f1e10 100644
--- a/utils/uds/fileUtils.c
+++ b/utils/uds/fileUtils.c
@@ -157,7 +157,7 @@ int syncAndCloseFile(int fd, const char *errorMessage)
/**********************************************************************/
void trySyncAndCloseFile(int fd)
{
- int result = syncAndCloseFile(fd, NULL);
+ int result = syncAndCloseFile(fd, "");
if (result != UDS_SUCCESS) {
logDebugWithStringError(result, "error syncing and closing file");
}
--
2.21.0

View File

@ -0,0 +1,38 @@
From a85f6e9973697f90d11e9beb1eb16206774e4767 Mon Sep 17 00:00:00 2001
From: "Christopher N. Hesse" <raymanfx@gmail.com>
Date: Wed, 3 Apr 2019 22:24:29 +0200
Subject: [PATCH 2/2] Ignore misaligned pointers
Signed-off-by: Christopher N. Hesse <raymanfx@gmail.com>
---
utils/vdo/base/Makefile | 1 +
utils/vdo/user/Makefile | 1 +
2 files changed, 2 insertions(+)
diff --git a/utils/vdo/base/Makefile b/utils/vdo/base/Makefile
index 4f2ed82..6d4c4e8 100644
--- a/utils/vdo/base/Makefile
+++ b/utils/vdo/base/Makefile
@@ -46,6 +46,7 @@ C_WARNS = \
-Wnested-externs \
-Wold-style-definition \
-Wswitch-default \
+ -Wno-address-of-packed-member \
OPT_FLAGS = -O3 -fno-omit-frame-pointer
DEBUG_FLAGS =
diff --git a/utils/vdo/user/Makefile b/utils/vdo/user/Makefile
index b0a60d0..811dd8a 100644
--- a/utils/vdo/user/Makefile
+++ b/utils/vdo/user/Makefile
@@ -48,6 +48,7 @@ C_WARNS = \
-Wnested-externs \
-Wold-style-definition \
-Wswitch-default \
+ -Wno-address-of-packed-member \
OPT_FLAGS = -O3 -fno-omit-frame-pointer
DEBUG_FLAGS =
--
2.21.0

View File

@ -3,11 +3,13 @@
Name: vdo Name: vdo
Version: 6.2.0.298 Version: 6.2.0.298
Release: 12 Release: 13
Summary: Management tools for Virtual Data Optimizer Summary: Management tools for Virtual Data Optimizer
License: GPLv2 License: GPLv2
URL: http://github.com/dm-vdo/vdo URL: http://github.com/dm-vdo/vdo
Source0: https://github.com/dm-vdo/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz Source0: https://github.com/dm-vdo/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
Patch0001: 0001-utils-fileUtils-Fix-null-string.patch
Patch0002: 0002-Ignore-misaligned-pointers.patch
BuildRequires: gcc libuuid-devel device-mapper-devel device-mapper-event-devel BuildRequires: gcc libuuid-devel device-mapper-devel device-mapper-event-devel
BuildRequires: valgrind-devel python3 python3-devel zlib-devel systemd BuildRequires: valgrind-devel python3 python3-devel zlib-devel systemd
@ -78,5 +80,8 @@ done
%{_mandir}/man8/* %{_mandir}/man8/*
%changelog %changelog
* Fri Jun 5 2020 leiju<leiju4@huawei.com> - 6.2.0.298-13
- Fix null string and misaligned pointers
* Tue Feb 18 2019 cangyi<cangyi@huawei.com> - 6.2.0.298-12 * Tue Feb 18 2019 cangyi<cangyi@huawei.com> - 6.2.0.298-12
- Package init - Package init