]> git.ipfire.org Git - thirdparty/systemd.git/commit
nspawn: check cg_ns_supported() just once
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 11 Dec 2018 11:00:06 +0000 (12:00 +0100)
committerChris Down <chris@chrisdown.name>
Tue, 11 Dec 2018 13:37:41 +0000 (13:37 +0000)
commit489fae526d6d8625ee7c4dd9221f1474518684de
treeaad3af68b67baa2aecdab5f740135ccafd8c2ade
parentba958bb18bf4a7e7d7781ac1aba2dfac32a2ecf5
nspawn: check cg_ns_supported() just once

cg_ns_supported() caches, so the condition was really checked just once, but
it looks weird to assign the return value to arg_use_cgns (if the variable is not present),
because then the other checks are effectively equivalent to
  if (cg_ns_supported() && cg_ns_supported()) { ...
and later
  if (!cg_ns_supported() || !cg_ns_supported()) { ...
src/nspawn/nspawn.c