diff options
Diffstat (limited to 'src/signalhandler_unittest.cc')
-rw-r--r-- | src/signalhandler_unittest.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/signalhandler_unittest.cc b/src/signalhandler_unittest.cc index 59be231..e85f523 100644 --- a/src/signalhandler_unittest.cc +++ b/src/signalhandler_unittest.cc @@ -34,7 +34,9 @@ #include "utilities.h" -#include <pthread.h> +#if defined(HAVE_PTHREAD) +# include <pthread.h> +#endif #include <signal.h> #include <stdio.h> #include <stdlib.h> @@ -87,12 +89,20 @@ int main(int argc, char **argv) { fprintf(stderr, "looping\n"); while (true); } else if (command == "die_in_thread") { +#if defined(HAVE_PTHREAD) pthread_t thread; pthread_create(&thread, NULL, &DieInThread, NULL); pthread_join(thread, NULL); +#else + fprintf(stderr, "no pthread\n"); + return 1; +#endif } else if (command == "dump_to_stdout") { InstallFailureWriter(WriteToStdout); abort(); + } else if (command == "installed") { + fprintf(stderr, "signal handler installed: %s\n", + IsFailureSignalHandlerInstalled() ? "true" : "false"); } else { // Tell the shell script puts("OK"); |