[lxc/lxc] 2b113b: cgroups: fix compiler warning

0 views
Skip to first unread message

Christian Brauner

unread,
Nov 29, 2021, 11:25:59 AM11/29/21
to lxc-...@lists.linuxcontainers.org
Branch: refs/heads/master
Home: https://github.com/lxc/lxc
Commit: 2b113b55c72a1345035343603125901d85a38f43
https://github.com/lxc/lxc/commit/2b113b55c72a1345035343603125901d85a38f43
Author: Tycho Andersen <ty...@tycho.pizza>
Date: 2021-11-29 (Mon, 29 Nov 2021)

Changed paths:
M src/lxc/cgroups/cgfsng.c

Log Message:
-----------
cgroups: fix compiler warning

I get:

In file included from cgroups/cgfsng.c:42:
In function 'cpuset1_cpus_initialize',
inlined from 'cpuset1_initialize' at cgroups/cgfsng.c:658:7,
inlined from '__cgroup_tree_create.constprop' at cgroups/cgfsng.c:723:26:
./log.h:376:9: error: '%s' directive argument is null [-Werror=format-overflow=]
376 | LXC_ERROR(&locinfo, format, ##__VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./log.h:457:17: note: in expansion of macro 'ERROR'
457 | ERROR("%s - " format, ptr, ##__VA_ARGS__); \
| ^~~~~
./log.h:491:17: note: in expansion of macro 'SYSERROR'
491 | SYSERROR(format, ##__VA_ARGS__); \
| ^~~~~~~~
cgroups/cgfsng.c:585:24: note: in expansion of macro 'log_error_errno'
585 | return log_error_errno(false, errno, "Failed to read file \"%s\"", fpath);
| ^~~~~~~~~~~~~~~

it turns out here that fpath is not used, so let's get rid of it and just
render the dfd+pathname directly.

Signed-off-by: Tycho Andersen <ty...@tycho.pizza>


Commit: 6a9cbecdaafdece460bfe1a61c20a78ac5d2468c
https://github.com/lxc/lxc/commit/6a9cbecdaafdece460bfe1a61c20a78ac5d2468c
Author: Christian Brauner <christia...@ubuntu.com>
Date: 2021-11-29 (Mon, 29 Nov 2021)

Changed paths:
M src/lxc/cgroups/cgfsng.c

Log Message:
-----------
Merge pull request #4040 from tych0/fix-cgroup-warning

cgroups: fix compiler warning


Compare: https://github.com/lxc/lxc/compare/7cf6f28ed858...6a9cbecdaafd
Reply all
Reply to author
Forward
0 new messages