diff options
author | aszlig <aszlig@nix.build> | 2017-11-30 06:42:49 +0100 |
---|---|---|
committer | aszlig <aszlig@nix.build> | 2017-11-30 08:33:59 +0100 |
commit | 38d3fe573f4d0ad2115eaca71a0b8f67fd01a580 (patch) | |
tree | d09bf338919056089be3b59194fa7b647794b15b /pkgs/build-support/build-sandbox/src/sandbox.c | |
parent | 28ac40c9d9e1c9afc63c19646f223b28b7ed3bc8 (diff) |
build-sandbox: Move to top-level build-support
This is not only useful for packaging games, so let's make it available from the vuizvui scope, so we can use it from other packages as well. Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/build-support/build-sandbox/src/sandbox.c')
-rw-r--r-- | pkgs/build-support/build-sandbox/src/sandbox.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/build-support/build-sandbox/src/sandbox.c b/pkgs/build-support/build-sandbox/src/sandbox.c new file mode 100644 index 00000000..e2aa47cf --- /dev/null +++ b/pkgs/build-support/build-sandbox/src/sandbox.c @@ -0,0 +1,21 @@ +#include <errno.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> + +#include "setup.h" + +int main(int argc, char **argv) +{ + if (!setup_sandbox()) + return 1; + + argv[0] = WRAPPED_PROGNAME; + if (execv(WRAPPED_PATH, argv) == -1) { + fprintf(stderr, "exec %s: %s\n", WRAPPED_PATH, strerror(errno)); + return 1; + } + + // Should never be reached. + return 1; +} |