about summary refs log tree commit diff
path: root/pkgs/games/build-support/build-sandbox/src/sandbox.c
blob: e2aa47cfbd3b1a35eb958aa3837c1fbbacb455c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
}