diff --git a/src/main.c b/src/main.c index adae1a8b..0e1ad899 100644 --- a/src/main.c +++ b/src/main.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -64,6 +63,10 @@ #include "plumbing/transcoding.h" #endif +#ifdef PLATFORM_LINUX +#include +#endif + /* Command line option struct */ typedef struct str_list { @@ -681,9 +684,13 @@ main(int argc, char **argv) /* Make dumpable */ if (opt_dump) { +#ifdef PLATFORM_LINUX if (chdir("/tmp")) tvhwarn("START", "failed to change cwd to /tmp"); prctl(PR_SET_DUMPABLE, 1); +#else + tvhwarn("START", "Coredumps not implemented on your platform"); +#endif } umask(0); diff --git a/src/wrappers.c b/src/wrappers.c index 07b08d07..2f85adc3 100644 --- a/src/wrappers.c +++ b/src/wrappers.c @@ -3,10 +3,13 @@ #include #include /* See NOTES */ #include -#include #include #include +#ifdef PLATFORM_LINUX +#include +#endif + int tvh_open(const char *pathname, int flags, mode_t mode) { @@ -94,8 +97,10 @@ thread_wrapper ( void *p ) { struct thread_state *ts = p; +#ifdef PLATFORM_LINUX /* Set name */ prctl(PR_SET_NAME, ts->name); +#endif /* Run */ tvhdebug("thread", "created thread %ld [%s / %p(%p)]",