]> git.proxmox.com Git - mirror_lxc.git/commit
cgroups: fix compiler warning
authorTycho Andersen <tycho@tycho.pizza>
Mon, 29 Nov 2021 13:38:30 +0000 (08:38 -0500)
committerTycho Andersen <tycho@tycho.pizza>
Mon, 29 Nov 2021 13:40:30 +0000 (08:40 -0500)
commit2b113b55c72a1345035343603125901d85a38f43
tree725df40f7b32045b6c4b376b70e0fa047dc75067
parent7cf6f28ed858307a40128dcfbd676067642d1f27
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 <tycho@tycho.pizza>
src/lxc/cgroups/cgfsng.c