about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2024-05-02 17:30:59 +0200
committerGitHub <noreply@github.com>2024-05-02 17:30:59 +0200
commit4ec376bd6a76c3a624d01961dcf15e83a28cda08 (patch)
tree13092674a18d6a3e7cfbf63e110fe0e7652dfc9f
parent26eaf53a832be0b12dadbbd290b4a7e676818347 (diff)
parent3c0448305b97ed2491b51814443eba6792df7dc7 (diff)
downloadafl++-4ec376bd6a76c3a624d01961dcf15e83a28cda08.tar.gz
Merge pull request #2076 from louismerlin/fix-whatsup-time
Fix `afl_whatsup` findings timer
-rwxr-xr-xafl-whatsup8
1 files changed, 7 insertions, 1 deletions
diff --git a/afl-whatsup b/afl-whatsup
index 55ef2473..19841755 100755
--- a/afl-whatsup
+++ b/afl-whatsup
@@ -111,7 +111,13 @@ if [ -z "$NO_COLOR" ]; then
   RESET="$NC"
 fi
 
-CUR_TIME=`date +%s`
+PLATFORM=`uname -s`
+if [ "$PLATFORM" = "Linux" ] ; then
+  CUR_TIME=`cat /proc/uptime | awk '{printf "%.0f\n", $1}'`
+else
+  # This will lead to inacurate results but will prevent the script from breaking on platforms other than Linux
+  CUR_TIME=`date +%s`
+fi
 
 TMP=`mktemp -t .afl-whatsup-XXXXXXXX` || TMP=`mktemp -p /data/local/tmp .afl-whatsup-XXXXXXXX` || TMP=`mktemp -p /data/local/tmp .afl-whatsup-XXXXXXXX` || exit 1
 trap "rm -f $TMP" 1 2 3 13 15