mirror of
https://github.com/void-linux/void-packages.git
synced 2025-04-16 06:07:00 +02:00
tcptrack: fix logic for showing idle-time >3600
This commit is contained in:
parent
16d806c7db
commit
8be09e4a3d
2 changed files with 31 additions and 1 deletions
30
srcpkgs/tcptrack/patches/format-time-t.patch
Normal file
30
srcpkgs/tcptrack/patches/format-time-t.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
Fix -Werror=format (hard error in gcc-12)
|
||||
|
||||
Also the last leg is unreachable,
|
||||
because when it's true, the second leg also true.
|
||||
Index: tcptrack-1.4.3/src/TextUI.cc
|
||||
===================================================================
|
||||
--- tcptrack-1.4.3.orig/src/TextUI.cc
|
||||
+++ tcptrack-1.4.3/src/TextUI.cc
|
||||
@@ -308,12 +308,15 @@ void TextUI::drawui()
|
||||
printw("RESET");
|
||||
|
||||
move(row,58);
|
||||
- if( ic->getIdleSeconds() < 60 )
|
||||
- printw("%ds",ic->getIdleSeconds());
|
||||
- else if( ic->getIdleSeconds() > 59 )
|
||||
- printw("%dm",ic->getIdleSeconds()/60);
|
||||
- else if( ic->getIdleSeconds() > 3559 )
|
||||
- printw("%dh",ic->getIdleSeconds()/3600);
|
||||
+ {
|
||||
+ long long int idle = ic->getIdleSeconds();
|
||||
+ if( idle < 60 )
|
||||
+ printw("%llds",idle);
|
||||
+ else if( idle > 3559 )
|
||||
+ printw("%lldh",idle/3600);
|
||||
+ else if( idle > 59 )
|
||||
+ printw("%lldm",idle/60);
|
||||
+ }
|
||||
|
||||
move(row,63);
|
||||
if( ic->activityToggle() )
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'tcptrack'
|
||||
pkgname=tcptrack
|
||||
version=1.4.3
|
||||
revision=2
|
||||
revision=3
|
||||
build_style=gnu-configure
|
||||
makedepends="libpcap-devel ncurses-devel"
|
||||
short_desc="Monitor TCP connections on network"
|
||||
|
|
Loading…
Add table
Reference in a new issue