From 1d9a35f53308b3a05d728ab2393bbf6325ac91e1 Mon Sep 17 00:00:00 2001 From: yangwei Date: Tue, 6 Aug 2019 18:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20#2=20=E6=8F=90=E5=8F=8A?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E9=97=B4=E7=BB=93=E6=9E=9C=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E5=9C=A8SIGINT=E4=BF=A1=E5=8F=B7?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=87=BD=E6=95=B0=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/common/abort.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index f3f921b..36ea009 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ tcpburst +.vscode diff --git a/src/common/abort.c b/src/common/abort.c index 37d730f..9f44133 100644 --- a/src/common/abort.c +++ b/src/common/abort.c @@ -34,6 +34,7 @@ #include "defines.h" #include "common.h" +#include #include #include @@ -76,6 +77,8 @@ break_now(int signo) kill(tcpdump.pid, SIGKILL); #endif */ + if (gettimeofday(&end, NULL) < 0) + errx(-1, "gettimeofday() failed: %s", strerror(errno)); packet_stats(&begin, &end, bytes_sent, pkts_sent, failed); exit(1); }