aboutsummaryrefslogtreecommitdiffstats
path: root/service/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'service/src/main.c')
-rw-r--r--service/src/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/service/src/main.c b/service/src/main.c
index dd8bca9..c571df9 100644
--- a/service/src/main.c
+++ b/service/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>
@@ -454,6 +455,12 @@ cleanexit()
free(resultdir);
}
+void
+timeout()
+{
+ die("time's up!\n");
+}
+
int
main()
{
@@ -461,6 +468,9 @@ main()
int exit, i, cmdlen;
char *cp, *arg;
+ signal(SIGALRM, timeout);
+ alarm(3);
+
if (!(envstr = getenv("RESULTDIR")))
die("RESULTDIR not defined\n");