aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Eckenfels <net-tools@lina.inka.de>2009-08-27 20:29:19 +0000
committerBernd Eckenfels <net-tools@lina.inka.de>2009-08-27 20:29:19 +0000
commit74f077eb7cf210c509ff3bd66e48c3236b7804b3 (patch)
treeb4bd4681a091cfb045bdf5136cff5bda167e0a43
parentCzech translation update by petr.pisar@atlas.cz (diff)
downloadnet-tools-74f077eb7cf210c509ff3bd66e48c3236b7804b3.tar.gz
net-tools-74f077eb7cf210c509ff3bd66e48c3236b7804b3.tar.bz2
net-tools-74f077eb7cf210c509ff3bd66e48c3236b7804b3.zip
Fix for Feature Request from ssb
[ Feature Request #4466 ] --continuous should flush stdout
-rw-r--r--netstat.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/netstat.c b/netstat.c
index c50c58f..053d713 100644
--- a/netstat.c
+++ b/netstat.c
@@ -6,7 +6,7 @@
* NET-3 Networking Distribution for the LINUX operating
* system.
*
- * Version: $Id: netstat.c,v 1.64 2009/07/28 01:40:17 ecki Exp $
+ * Version: $Id: netstat.c,v 1.65 2009/08/27 20:29:19 ecki Exp $
*
* Authors: Fred Baumgarten, <dc6iq@insu1.etec.uni-karlsruhe.de>
* Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
@@ -299,6 +299,12 @@ static void prg_cache_clear(void)
prg_cache_loaded=0;
}
+static void wait_continous(void)
+{
+ fflush(stdout);
+ sleep(1);
+}
+
static int extract_type_1_socket_inode(const char lname[], unsigned long * inode_p) {
/* If lname is of the form "socket:[12345]", extract the "12345"
@@ -1725,7 +1731,7 @@ int main
flag_not & FLAG_NUM_PORT, flag_exp);
if (i || !flag_cnt)
break;
- sleep(1);
+ wait_continous();
}
#else
ENOSUPP("netstat", "FW_MASQUERADE");
@@ -1778,7 +1784,7 @@ int main
i = route_info(afname, options);
if (i || !flag_cnt)
break;
- sleep(1);
+ wait_continous();
}
return (i);
}
@@ -1787,7 +1793,7 @@ int main
i = iface_info();
if (!flag_cnt || i)
break;
- sleep(1);
+ wait_continous();
}
return (i);
}
@@ -1934,7 +1940,7 @@ int main
if (!flag_cnt || i)
break;
- sleep(1);
+ wait_continous();
prg_cache_clear();
}
return (i);