commit 6c982e54c4f30e173216f193e28faa9d3e02f4be
parent 078e9361d75bfb22a49dfdc1de3c0e0ae03c9f48
Author: Frederic Cambus <fred@statdns.com>
Date: Wed, 10 Jun 2020 16:31:04 +0200
Add a signal handler for SIGINFO, to display progression on supported platforms.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/statzone.c b/src/statzone.c
@@ -13,6 +13,7 @@
#include <err.h>
#include <getopt.h>
#include <inttypes.h>
+#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -109,6 +110,10 @@ main(int argc, char *argv[])
}
#endif
+#ifdef SIGINFO
+ signal(SIGINFO, displaySummary);
+#endif
+
while ((getoptFlag = getopt(argc, argv, "hv")) != -1) {
switch (getoptFlag) {