jail: ignore return value when creating default /dev symlinks
authorDaniel Golle <daniel@makrotopia.org>
Wed, 4 Aug 2021 14:04:59 +0000 (15:04 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 4 Aug 2021 14:50:11 +0000 (15:50 +0100)
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 <daniel@makrotopia.org>
jail/jail.c

index beb46f55e9d50c57b0555c019dffaeb0dfc6c671..2fa3b2a885d0b4478f8dcc780d26bb33cf5d5c08 100644 (file)
@@ -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);