jail: fix various ignoring return value compilation warning
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 17 Jul 2022 11:11:36 +0000 (13:11 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Sun, 17 Jul 2022 11:14:00 +0000 (13:14 +0200)
commitef5d3e36e8b23ee2e1989c22717b21649dc9a388
treeb12e3a292dd6727c4102eafba700480db659a1c8
parent8e4a956604d65b2ca756b57114455e034de6b3d4
jail: fix various ignoring return value compilation warning

This fix the following compilation error:
jail/jail.c: In function 'main':
jail/jail.c:2733:33: error: ignoring return value of 'asprintf' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 2733 |                                 asprintf(&opts.envp[envc++], "%s=%s", enve->envarg, tmp);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jail/jail.c: In function 'build_jail_fs':
jail/jail.c:740:24: error: ignoring return value of 'symlink' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  740 |                 (void) symlink("../dev/resolv.conf.d/resolv.conf.auto", jaillink);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jail/jail.c: In function 'create_devices':
jail/jail.c:643:16: error: ignoring return value of 'symlink' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  643 |         (void) symlink("/dev/pts/ptmx", "/dev/ptmx");
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jail/jail.c:644:16: error: ignoring return value of 'symlink' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  644 |         (void) symlink("/proc/self/fd", "/dev/fd");
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jail/jail.c:645:16: error: ignoring return value of 'symlink' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  645 |         (void) symlink("/proc/self/fd/0", "/dev/stdin");
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jail/jail.c:646:16: error: ignoring return value of 'symlink' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  646 |         (void) symlink("/proc/self/fd/1", "/dev/stdout");
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jail/jail.c:647:16: error: ignoring return value of 'symlink' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  647 |         (void) symlink("/proc/self/fd/2", "/dev/stderr");
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
jail/jail.c