!27 pacemaker: Remove const warning

From: @bizhiyuan 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
This commit is contained in:
openeuler-ci-bot 2024-02-20 09:13:34 +00:00 committed by Gitee
commit def0bfbd73
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 39 additions and 2 deletions

View File

@ -0,0 +1,33 @@
From b448d6b97aefdce92d92c574e71a40111d9957aa Mon Sep 17 00:00:00 2001
From: bizhiyuan <bizhiyuan@kylinos.cn>
Date: Tue, 20 Feb 2024 15:52:19 +0800
Subject: [PATCH] Remove const warning
---
src/pacemaker.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/pacemaker.c b/src/pacemaker.c
index 4d8f2b5..5c4c1de 100644
--- a/src/pacemaker.c
+++ b/src/pacemaker.c
@@ -434,7 +434,6 @@ static int parse_ticket_state(struct ticket_config *tk, FILE *p)
GString *input = NULL;
char line[CHUNK_SIZE];
xmlDocPtr doc = NULL;
- xmlErrorPtr errptr;
int opts = XML_PARSE_COMPACT | XML_PARSE_NONET;
/* skip first two lines of output */
@@ -459,7 +458,7 @@ static int parse_ticket_state(struct ticket_config *tk, FILE *p)
doc = xmlReadDoc((const xmlChar *) input->str, NULL, NULL, opts);
if (doc == NULL) {
- errptr = xmlGetLastError();
+ const xmlError *errptr = xmlGetLastError();
if (errptr) {
tk_log_error("crm_ticket xml parse failed (domain=%d, level=%d, code=%d): %s",
errptr->domain, errptr->level,
--
2.25.1

View File

@ -24,7 +24,7 @@
%bcond_with run_build_tests
%bcond_with include_unit_test
%global release 1
%global release 2
## User and group to use for nonprivileged services (should be in sync with pacemaker)
%global uname hacluster
@ -48,6 +48,7 @@ Summary: Ticket Manager for Multi-site Clusters
License: GPL-2.0-or-later
Url: https://github.com/%{github_owner}/%{name}
Source0: https://github.com/%{github_owner}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Patch0: Remove-const-warning.patch
# direct build process dependencies
BuildRequires: autoconf
@ -178,7 +179,7 @@ Automated tests for running Booth, ticket manager for multi-site clusters.
# BUILD #
%prep
%autosetup -n %{name}-%{version} -S git_am
%autosetup -n %{name}-%{version} -S git_am -p 1
%build
./autogen.sh
@ -296,6 +297,9 @@ VERBOSE=1 make check
%{_usr}/lib/ocf/resource.d/booth/sharedrsc
%changelog
* Tue Feb 20 2024 bizhiyuan <bizhiyuan@kylinos.cn> - 1.1-2
- pacemaker: Remove const warning
* Fri Nov 17 2023 bizhiyuan <bizhiyuan@kylinos.cn> - 1.1-1
- Update to version 1.1