From be08f938ac97313d0651c5f1a583e973f7dc01b9 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Tue, 31 Aug 2004 08:46:43 +0000 Subject: [PATCH] print note while waiting for first packet to arrive --- nethogs.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nethogs.cpp b/nethogs.cpp index 4c0bee9..a1753ca 100644 --- a/nethogs.cpp +++ b/nethogs.cpp @@ -185,6 +185,13 @@ int main (int argc, char** argv) pcap_t * newhandle = pcap_open_live(current_dev->name, BUFSIZ, 0, 100, errbuf); if (newhandle != NULL) { + /* The following code solves sf.net bug 1019381, but is only available + * in newer versions of libpcap */ + + /*if (pcap_setnonblock (newhandle, 1, errbuf) == -1) + { + // ERROR + }*/ handles = new handle (newhandle, current_dev->name, handles); } @@ -194,6 +201,7 @@ int main (int argc, char** argv) signal (SIGALRM, &alarm_cb); signal (SIGINT, &quit_cb); alarm (refreshdelay); + fprintf(stderr, "Waiting for first packet to arrive (see sourceforge.net bug 1019381)\n"); while (1) { handle * current_handle = handles;