only define safe_fork() in systems with linux namespaces

This commit is contained in:
Nikos Mavrogiannopoulos
2015-01-19 10:49:01 +01:00
parent c954e45e53
commit cb5499a6b7
2 changed files with 6 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ pid_t safe_fork(void)
return -1;
return ret;
#else
return fork();
return -1;
#endif
}

View File

@@ -36,7 +36,12 @@ typedef void (*sighandler_t)(int);
# define SIGHANDLER_T sighandler_t
#endif
#if defined(__linux__) && defined(ENABLE_LINUX_NS)
pid_t safe_fork(void);
#else
# define safe_fork fork
#endif
void pr_set_undumpable(const char* mod);
void kill_on_parent_kill(int sig);