From f99d9eadde4b53720fb97f09f1bcd730dd3fa3e4 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Tue, 29 Jun 2004 13:43:31 +0000 Subject: [PATCH] * Fix to a segfault resulting from 'ifdown eth0 ; nethogs' * changes moved to Changelog Both thanks to Fabian Frederick --- nethogs.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/nethogs.cpp b/nethogs.cpp index 1e68c5f..56593e5 100644 --- a/nethogs.cpp +++ b/nethogs.cpp @@ -1,21 +1,5 @@ /* nethogs.cpp * - * Updates: - * - * 14/02/04 (Fabian) - * -Refresh delay - * -Help - * -Handling command-line options - * - * 06/04/04 (Fabian) - * -getLocal - * -I/O by balance - * -forceExit - * - * 10/05/04 (Arnout) - * -cleanups - * -splitting out incoming and outgoing traffic - * (based on 'I/O by balance' by Fabian) */ #include "nethogs.h" @@ -159,6 +143,9 @@ int main (int argc, char** argv) pcap_t * handle; handle = pcap_open_live(dev, BUFSIZ, 0, 1000, errbuf); + if (!handle) + forceExit("Device is not active"); + signal (SIGALRM, &alarm_cb); signal (SIGINT, &quit_cb); alarm (refreshdelay);