lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428933661-8193-7-git-send-email-pavlix@pavlix.net>
Date:	Mon, 13 Apr 2015 16:01:01 +0200
From:	Pavel Šimerda <pavlix@...lix.net>
To:	netdev@...r.kernel.org
Cc:	stephen@...workplumber.org, psimerda@...hat.com
Subject: [PATCH 7/7] lnstat: run indefinitely by default

From: Pavel Šimerda <psimerda@...hat.com>

See also:

 * https://bugzilla.redhat.com/show_bug.cgi?id=977845

Signed-off-by: Pavel Šimerda <psimerda@...hat.com>
---
 misc/lnstat.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/misc/lnstat.c b/misc/lnstat.c
index e105b70..0385cbb 100644
--- a/misc/lnstat.c
+++ b/misc/lnstat.c
@@ -249,7 +249,7 @@ int main(int argc, char **argv)
 		MODE_JSON,
 		MODE_NORMAL,
 	} mode = MODE_NORMAL;
-	unsigned long count = 1;
+	unsigned long count = 0;
 	struct table_hdr *header;
 	static struct field_params fp;
 	int num_req_files = 0;
@@ -362,7 +362,7 @@ int main(int argc, char **argv)
 		if (interval < 1 )
 			interval = 1;
 
-		for (i = 0; i < count; i++) {
+		for (i = 0; i < count || !count; ) {
 			lnstat_update(lnstat_files);
 			if (mode == MODE_JSON)
 				print_json(stdout, lnstat_files, &fp);
@@ -373,8 +373,10 @@ int main(int argc, char **argv)
 				print_line(stdout, lnstat_files, &fp);
 			}
 			fflush(stdout);
-			if (i < count - 1)
+			if (i < count - 1 || !count)
 				sleep(interval);
+			if (count)
+				++i;
 		}
 		break;
 	}
-- 
2.3.5

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ