From 6d5c900167e61012c1c655402016d11161b2d2c4 Mon Sep 17 00:00:00 2001 From: haozi007 Date: Thu, 17 Mar 2022 02:43:06 +0000 Subject: [PATCH] fix unnecessary error message print Signed-off-by: haozi007 (cherry picked from commit 0ab60710491349088b1251d1a4d32d587b02532b) --- ...ust-print-error-when-new-lock-failed.patch | 30 +++++++++++++++++++ lxc.spec | 9 +++++- series.conf | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 0038-just-print-error-when-new-lock-failed.patch diff --git a/0038-just-print-error-when-new-lock-failed.patch b/0038-just-print-error-when-new-lock-failed.patch new file mode 100644 index 0000000..d6d9037 --- /dev/null +++ b/0038-just-print-error-when-new-lock-failed.patch @@ -0,0 +1,30 @@ +From 456d154a6e0a34ac8e4474408ea02f2e0ec6e194 Mon Sep 17 00:00:00 2001 +From: haozi007 +Date: Thu, 17 Mar 2022 02:39:46 +0000 +Subject: [PATCH] just print error when new lock failed + +Signed-off-by: haozi007 +--- + 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 + diff --git a/lxc.spec b/lxc.spec index 35807a5..5a5c9c7 100644 --- a/lxc.spec +++ b/lxc.spec @@ -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 - 4.0.3-2022031701 +- Type:improv +- ID:NA +- SUG:NA +- DESC: fix unnecessary print error message + * Mon Feb 21 2022 chegJH - 4.0.3-2022022101 - Type:improv - ID:NA diff --git a/series.conf b/series.conf index 89a1d80..eb4eb15 100644 --- a/series.conf +++ b/series.conf @@ -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 -- Gitee