diff options
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -5,6 +5,7 @@ #include <fcntl.h> #include <time.h> #include <errno.h> +#include <signal.h> #include <sys/stat.h> #include <sys/file.h> @@ -458,6 +459,12 @@ cleanexit() free(resultdir); } +void +timeout() +{ + die("time's up!\n"); +} + int main() { @@ -465,6 +472,9 @@ main() int exit, i, cmdlen; char *cp, *arg; + signal(SIGALRM, timeout); + alarm(180); + if (!(envstr = getenv("RESULTDIR"))) die("RESULTDIR not defined\n"); |
