[lxc/lxc] 28b2e0: cgroups: fix compiler warning

Skip to first unread message

Tycho Andersen

Nov 30, 2021, 7:19:13 AM11/30/21
to lxc-...@lists.linuxcontainers.org
Branch: refs/heads/stable-4.0
Home: https://github.com/lxc/lxc
Commit: 28b2e04f17ab92922f48899a86f72e29bdd1e9f0
Author: Tycho Andersen <ty...@tycho.pizza>
Date: 2021-11-30 (Tue, 30 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: 93edd510ae9980b3ea9fe6d68bff8df7aa0169a7
Author: Tycho Andersen <ty...@tycho.pizza>
Date: 2021-11-30 (Tue, 30 Nov 2021)

Changed paths:
M src/lxc/lxccontainer.c

Log Message:
api: ->save_config() doesn't need to create container dir

If we're saving the config file to somewhere that's *not* the container
dir, we don't need to create the container dir. Let's not do this and
thus not require its parent to exist, which can be confusing, especially in
light of the sparse logging through these functions.

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

Compare: https://github.com/lxc/lxc/compare/15515f9a3bdb...93edd510ae99
Reply all
Reply to author
0 new messages