diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-07-09 09:39:44 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-07-09 09:42:49 +0200 |
| commit | 857e53cf30d17a1fe87b683bb26a54899760dcd8 (patch) | |
| tree | 08fd67c4243150403a48c376f80272df5f6096f1 /service/src/main.c | |
| parent | f9add70b96f8d5e1544547be8feebc9a71f7ece8 (diff) | |
| download | enowars5-service-stldoctor-857e53cf30d17a1fe87b683bb26a54899760dcd8.tar.gz enowars5-service-stldoctor-857e53cf30d17a1fe87b683bb26a54899760dcd8.zip | |
various improvements to logging and performance
added service timeout (180s), improved debug logging, moved persistence checking havocs into single noise by selecting randomly which type of stl to upload (still check correctness of parsing of any type in havocs)
Diffstat (limited to 'service/src/main.c')
| -rw-r--r-- | service/src/main.c | 10 |
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"); |
