!247 fix unnecessary error message print

From: @duguhaotian 
Reviewed-by: @wangfengtu, @jingwoo, @jingxiaolu 
Signed-off-by: @jingxiaolu
This commit is contained in:
openeuler-ci-bot 2022-03-17 03:04:20 +00:00 committed by Gitee
commit 79ab1b2d28
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From 456d154a6e0a34ac8e4474408ea02f2e0ec6e194 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Thu, 17 Mar 2022 02:39:46 +0000
Subject: [PATCH] just print error when new lock failed
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
src/lxc/lxclock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxclock.c b/src/lxc/lxclock.c
index 9c9b57c..7114fc5 100644
--- a/src/lxc/lxclock.c
+++ b/src/lxc/lxclock.c
@@ -177,10 +177,10 @@ struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name)
}
l->u.f.fd = -1;
- return l;
on_error:
- fprintf(stderr, "Failed to create lock for %s, path %s\n", name, lxcpath);
+ if (l == NULL)
+ fprintf(stderr, "Failed to create lock for %s, path %s\n", name, lxcpath);
return l;
}
--
2.20.1

View File

@ -1,4 +1,4 @@
%global _release 2022022101
%global _release 2022031701
Name: lxc
Version: 4.0.3
@ -45,6 +45,7 @@ Patch0034: 0034-cgfsng-fix-cgroup-attach-cgroup-creation.patch
Patch0035: 0035-adapt-upstream-compiler-settings.patch
Patch0036: 0036-compile-in-android-env.patch
Patch0037: 0037-fix-always-print-and-temp-len.patch
Patch0038: 0038-just-print-error-when-new-lock-failed.patch
BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath
BuildRequires: pkgconfig(libseccomp)
@ -216,6 +217,12 @@ make check
%{_mandir}/*/man7/%{name}*
%changelog
* Thu Mar 17 2022 haozi007<liuhao27@huawei.com> - 4.0.3-2022031701
- Type:improv
- ID:NA
- SUG:NA
- DESC: fix unnecessary print error message
* Mon Feb 21 2022 chegJH <hejunjie10@huawei.com> - 4.0.3-2022022101
- Type:improv
- ID:NA

View File

@ -35,3 +35,4 @@
0035-adapt-upstream-compiler-settings.patch
0036-compile-in-android-env.patch
0037-fix-always-print-and-temp-len.patch
0038-just-print-error-when-new-lock-failed.patch