[lxc-devel] [PATCH] fix compilation error in cgmanager.c
Serge Hallyn
serge.hallyn at ubuntu.com
Thu Jan 16 14:29:20 UTC 2014
Quoting S.Çağlar Onur (caglar at 10ur.org):
> Currently it fails like following
>
> gcc -DHAVE_CONFIG_H -I. -I../../src -D_FORTIFY_SOURCE=2 -fPIC -DPIC -I../../src -DLXCROOTFSMOUNT=\"/usr/lib/x86_64-linux-gnu/lxc/rootfs\" -DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/libexec\" -DLXCTEMPLATEDIR=\"/usr/share/lxc/templates\" -DLOGPATH=\"/var/log/lxc\" -DLXC_DEFAULT_CONFIG=\"/etc/lxc/default.conf\" -DLXC_USERNIC_DB=\"/run/lxc/nics\" -DLXC_USERNIC_CONF=\"/etc/lxc/lxc-usernet\" -DDEFAULT_CGROUP_PATTERN=\"/lxc/%n\" -DHAVE_APPARMOR -DHAVE_CGMANAGER -DHAVE_SELINUX -DHAVE_SECCOMP -pthread -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -Werror -MT liblxc_so-cgmanager.o -MD -MP -MF .deps/liblxc_so-cgmanager.Tpo -c -o liblxc_so-cgmanager.o `test -f 'cgmanager.c' || echo './'`cgmanager.c
> In file included from cgmanager.c:48:0:
> cgmanager.c: In function ‘cgmanager_remove_cgroup’:
> log.h:247:9: error: format ‘%s’ expects a matching ‘char *’ argument [-Werror=format=]
> struct lxc_log_locinfo locinfo = LXC_LOG_LOCINFO_INIT; \
> ^
> cgmanager.c:142:3: note: in expansion of macro ‘INFO’
> INFO("cgroup removal attempt: %s:%s did not exist");
> ^
> log.h:247:9: error: format ‘%s’ expects a matching ‘char *’ argument [-Werror=format=]
> struct lxc_log_locinfo locinfo = LXC_LOG_LOCINFO_INIT; \
> ^
> cgmanager.c:142:3: note: in expansion of macro ‘INFO’
> INFO("cgroup removal attempt: %s:%s did not exist");
> ^
> cc1: all warnings being treated as errors
> make[3]: *** [liblxc_so-cgmanager.o] Error 1
>
> Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
Gah. I had this fixed this on my test box but never moved the fix back
to my git tree.
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> ---
> src/lxc/cgmanager.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c
> index 21083da..14d753f 100644
> --- a/src/lxc/cgmanager.c
> +++ b/src/lxc/cgmanager.c
> @@ -138,7 +138,7 @@ void cgmanager_remove_cgroup(const char *controller, const char *path)
> path, CG_REMOVE_RECURSIVE, &existed) != 0)
> ERROR("Error removing %s:%s", controller, path);
> if (!existed)
> - INFO("cgroup removal attempt: %s:%s did not exist");
> + INFO("cgroup removal attempt: %s:%s did not exist", controller, path);
> }
>
> static void cgm_destroy(struct lxc_handler *handler)
> --
> 1.8.3.2
>
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
More information about the lxc-devel
mailing list