aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index ff04849..cf4c3dc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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");