From 0c437e52d689f7be6448ee8b0c19ce2db9a5806c Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Sun, 23 Nov 2025 08:11:43 +0530 Subject: [PATCH] daemon: bind_mount: Initialize struct bind_state with compound literal Signed-off-by: Susant Sahani --- daemon/sh.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/daemon/sh.c b/daemon/sh.c index f8440c1dd..74e003410 100644 --- a/daemon/sh.c +++ b/daemon/sh.c @@ -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 ||