void os_setup_post(void)

{

    int fd = 0;



    if (daemonize) {

        uint8_t status = 0;

        ssize_t len;



    again1:

        len = write(daemon_pipe, &status, 1);

        if (len == -1 && (errno == EINTR)) {

            goto again1;

        }

        if (len != 1) {

            exit(1);

        }

        if (chdir("/")) {

            perror("not able to chdir to /");

            exit(1);

        }

        TFR(fd = qemu_open("/dev/null", O_RDWR));

        if (fd == -1) {

            exit(1);

        }

    }



    change_root();

    change_process_uid();



    if (daemonize) {

        dup2(fd, 0);

        dup2(fd, 1);

        dup2(fd, 2);



        close(fd);

    }

}

void os_setup_post(void)

{

    int fd = 0;



    if (daemonize) {

        uint8_t status = 0;

        ssize_t len;



    again1:

        len = write(daemon_pipe, &status, 1);

        if (len == -1 && (errno == EINTR)) {

            goto again1;

        }

        if (len != 1) {

            exit(1);

        }

        if (chdir("/")) {

            perror("not able to chdir to /");

            exit(1);

        }

        TFR(fd = qemu_open("/dev/null", O_RDWR));

        if (fd == -1) {

            exit(1);

        }

    }



    change_root();

    change_process_uid();



    if (daemonize) {

        dup2(fd, 0);

        dup2(fd, 1);

        dup2(fd, 2);



        close(fd);

    }

}

void FUNC_0(void)

{

    int VAR_0 = 0;



    if (daemonize) {

        uint8_t status = 0;

        ssize_t len;



    again1:

        len = write(daemon_pipe, &status, 1);

        if (len == -1 && (errno == EINTR)) {

            goto again1;

        }

        if (len != 1) {

            exit(1);

        }

        if (chdir("/")) {

            perror("not able to chdir to /");

            exit(1);

        }

        TFR(VAR_0 = qemu_open("/dev/null", O_RDWR));

        if (VAR_0 == -1) {

            exit(1);

        }

    }



    change_root();

    change_process_uid();



    if (daemonize) {

        dup2(VAR_0, 0);

        dup2(VAR_0, 1);

        dup2(VAR_0, 2);



        close(VAR_0);

    }

}

void FUNC_0(void)
{ int VAR_0 = 0; if (daemonize) { uint8_t status = 0; ssize_t len; again1:
len = write(daemon_pipe, &status, 1); if (len == -1 && (errno == EINTR)) { goto again1; } if (len != 1) { exit(1); } if (chdir("/")) { perror("not able to chdir to /"); exit(1); } TFR(VAR_0 = qemu_open("/dev/null", O_RDWR)); if (VAR_0 == -1) { exit(1); } } change_root(); change_process_uid(); if (daemonize) { dup2(VAR_0, 0); dup2(VAR_0, 1); dup2(VAR_0, 2); close(VAR_0); } }