From a4b7c5728090d1c0b6374773f7ab9b1b909e9c1b Mon Sep 17 00:00:00 2001 From: chegJH Date: Tue, 1 Mar 2022 16:30:04 +0800 Subject: [PATCH] fix print and len Signed-off-by: chegJH --- 0037-fix-always-print-and-temp-len.patch | 39 ++++++++++++++++++++++++ lxc.spec | 9 +++++- series.conf | 1 + 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0037-fix-always-print-and-temp-len.patch diff --git a/0037-fix-always-print-and-temp-len.patch b/0037-fix-always-print-and-temp-len.patch new file mode 100644 index 0000000..b9ccdf5 --- /dev/null +++ b/0037-fix-always-print-and-temp-len.patch @@ -0,0 +1,39 @@ +From 178d09524a346cab9ca1f9eb939e35945b7bfbb0 Mon Sep 17 00:00:00 2001 +From: chegJH +Date: Mon, 21 Feb 2022 19:14:56 +0800 +Subject: [PATCH] fix always print and temp len + +Signed-off-by: chegJH +--- + src/lxc/confile_utils.h | 2 +- + src/lxc/lxclock.c | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/lxc/confile_utils.h b/src/lxc/confile_utils.h +index 62990e9..3655ec4 100644 +--- a/src/lxc/confile_utils.h ++++ b/src/lxc/confile_utils.h +@@ -13,7 +13,7 @@ + if (str) \ + len = snprintf(str, inlen, ##__VA_ARGS__); \ + else \ +- len = snprintf((char *){""}, 0, ##__VA_ARGS__); \ ++ len = 0; \ + if (len < 0) { \ + SYSERROR("failed to create string"); \ + return -1; \ +diff --git a/src/lxc/lxclock.c b/src/lxc/lxclock.c +index d65c614..9c9b57c 100644 +--- a/src/lxc/lxclock.c ++++ b/src/lxc/lxclock.c +@@ -177,6 +177,7 @@ 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); +-- +2.32.0 (Apple Git-132) + diff --git a/lxc.spec b/lxc.spec index e906587..35807a5 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022021501 +%global _release 2022022101 Name: lxc Version: 4.0.3 @@ -44,6 +44,7 @@ Patch0033: 0033-conf-ensure-that-the-idmap-pointer-itself-is-freed.patch 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 BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -215,6 +216,12 @@ make check %{_mandir}/*/man7/%{name}* %changelog +* Mon Feb 21 2022 chegJH - 4.0.3-2022022101 +- Type:improv +- ID:NA +- SUG:NA +- DESC: fix alwasy print and len + * Tue Feb 15 2022 chegJH - 4.0.3-2022021501 - Type:improve - ID:NA diff --git a/series.conf b/series.conf index b2cb785..89a1d80 100644 --- a/series.conf +++ b/series.conf @@ -34,3 +34,4 @@ 0034-cgfsng-fix-cgroup-attach-cgroup-creation.patch 0035-adapt-upstream-compiler-settings.patch 0036-compile-in-android-env.patch +0037-fix-always-print-and-temp-len.patch -- Gitee