From 220b7160dbabe39a562b5e6cbd43acc1bc9f8e06 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 4 Aug 2021 15:04:59 +0100 Subject: [PATCH] jail: ignore return value when creating default /dev symlinks Just to silence compiler warning, as failure to create these symlinks doesn't indicate an error in all cases, e.g. in case mount is already defined in place of the symlink. Signed-off-by: Daniel Golle --- jail/jail.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jail/jail.c b/jail/jail.c index beb46f5..2fa3b2a 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -607,11 +607,11 @@ only_default_devices: } /* Dev symbolic links as defined in OCI spec */ - symlink("/dev/pts/ptmx", "/dev/ptmx"); - symlink("/proc/self/fd", "/dev/fd"); - symlink("/proc/self/fd/0", "/dev/stdin"); - symlink("/proc/self/fd/1", "/dev/stdout"); - symlink("/proc/self/fd/2", "/dev/stderr"); + (void) symlink("/dev/pts/ptmx", "/dev/ptmx"); + (void) symlink("/proc/self/fd", "/dev/fd"); + (void) symlink("/proc/self/fd/0", "/dev/stdin"); + (void) symlink("/proc/self/fd/1", "/dev/stdout"); + (void) symlink("/proc/self/fd/2", "/dev/stderr"); return 0; } @@ -704,7 +704,7 @@ static int build_jail_fs(void) if (overlaydir) unlink(jaillink); - symlink("../dev/resolv.conf.d/resolv.conf.auto", jaillink); + (void) symlink("../dev/resolv.conf.d/resolv.conf.auto", jaillink); } run_hooks(opts.hooks.createContainer, enter_jail_fs); -- 2.30.2