daemon: bind_mount: Initialize struct bind_state with compound literal

Signed-off-by: Susant Sahani <ssahani@redhat.com>
This commit is contained in:
Susant Sahani
2025-11-23 08:11:43 +05:30
committed by Richard W.M. Jones
parent 799b04fe3e
commit 0c437e52d6

View File

@@ -65,14 +65,14 @@ bind_mount (struct bind_state *bs)
{
int r;
memset (bs, 0, sizeof *bs);
bs->sysroot_dev = sysroot_path ("/dev");
bs->sysroot_dev_pts = sysroot_path ("/dev/pts");
bs->sysroot_proc = sysroot_path ("/proc");
bs->sysroot_selinux = sysroot_path ("/selinux");
bs->sysroot_sys = sysroot_path ("/sys");
bs->sysroot_sys_fs_selinux = sysroot_path ("/sys/fs/selinux");
*bs = (struct bind_state){
.sysroot_dev = sysroot_path ("/dev"),
.sysroot_dev_pts = sysroot_path ("/dev/pts"),
.sysroot_proc = sysroot_path ("/proc"),
.sysroot_selinux = sysroot_path ("/selinux"),
.sysroot_sys = sysroot_path ("/sys"),
.sysroot_sys_fs_selinux = sysroot_path ("/sys/fs/selinux"),
};
if (bs->sysroot_dev == NULL || bs->sysroot_dev_pts == NULL ||
bs->sysroot_proc == NULL || bs->sysroot_selinux == NULL ||