From 9325a4fcbb8eb4ed1d71f93de5301bf1a9a68253 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Sat, 6 Nov 2021 10:28:22 +0100 Subject: http->https --- afl-plot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'afl-plot') diff --git a/afl-plot b/afl-plot index 87b9caae..1ea1fc55 100755 --- a/afl-plot +++ b/afl-plot @@ -12,7 +12,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # get_abs_path() { -- cgit 1.4.1 From d92d1e568536518132d4ef4cb4121638ff38969e Mon Sep 17 00:00:00 2001 From: Dhruv Maroo Date: Mon, 8 Nov 2021 01:46:53 +0530 Subject: Use FIFOs instead of hacky sleep code to pass messages --- afl-plot | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'afl-plot') diff --git a/afl-plot b/afl-plot index 1ea1fc55..03be2e91 100755 --- a/afl-plot +++ b/afl-plot @@ -196,14 +196,15 @@ exit 1 fi mkdir -p "$outputdir/tmp" +mkfifo "$outputdir/tmp/win_ids" afl-plot-ui > "$outputdir/tmp/win_ids" & -sleep 0.5 +W_IDS=$(cat $outputdir/tmp/win_ids) -W_ID1=$(cat $outputdir/tmp/win_ids | head -1) -W_ID2=$(cat $outputdir/tmp/win_ids | head -2 | tail -1) -W_ID3=$(cat $outputdir/tmp/win_ids | head -3 | tail -1) -W_ID4=$(cat $outputdir/tmp/win_ids | tail -1) +W_ID1=$(echo "$W_IDS" | head -1) +W_ID2=$(echo "$W_IDS" | head -2 | tail -1) +W_ID3=$(echo "$W_IDS" | head -3 | tail -1) +W_ID4=$(echo "$W_IDS" | tail -1) echo "[*] Generating plots..." -- cgit 1.4.1 From c94f07bfdfd052d18cc02ab9977a539e6e64734f Mon Sep 17 00:00:00 2001 From: Dhruv Maroo Date: Mon, 8 Nov 2021 10:17:05 +0530 Subject: Cleanup earlier * Exit if mkfifo fails * Use .tmp so that in any case the cleanup fails, user doesn't have to see this dir unless explicitly listing hidden files --- afl-plot | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'afl-plot') diff --git a/afl-plot b/afl-plot index 03be2e91..1029d5a0 100755 --- a/afl-plot +++ b/afl-plot @@ -195,11 +195,17 @@ exit 1 fi -mkdir -p "$outputdir/tmp" -mkfifo "$outputdir/tmp/win_ids" -afl-plot-ui > "$outputdir/tmp/win_ids" & +mkdir -p "$outputdir/.tmp" +rm -f "$outputdir/.tmp/win_ids" +mkfifo "$outputdir/.tmp/win_ids" || exit 1 -W_IDS=$(cat $outputdir/tmp/win_ids) +afl-plot-ui > "$outputdir/.tmp/win_ids" & +W_IDS=$(cat "$outputdir/.tmp/win_ids") + +rm -f "$outputdir/.tmp/win_ids" +if [ -z "$(ls -A $outputdir/.tmp)" ]; then + rm -rf "$outputdir/.tmp" +fi W_ID1=$(echo "$W_IDS" | head -1) W_ID2=$(echo "$W_IDS" | head -2 | tail -1) @@ -266,12 +272,6 @@ _EOF_ sleep 1 -rm "$outputdir/tmp/win_ids" - -if [ -z "$(ls -A $outputdir/tmp)" ]; then - rm -r "$outputdir/tmp" -fi - else echo "[*] Generating plots..." -- cgit 1.4.1 From 33f9af976be98b14ea185c1415e25d39acc0595a Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Mon, 8 Nov 2021 09:44:47 +0100 Subject: nits --- afl-plot | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'afl-plot') diff --git a/afl-plot b/afl-plot index 1029d5a0..75981d7f 100755 --- a/afl-plot +++ b/afl-plot @@ -195,22 +195,19 @@ exit 1 fi +rm -rf "$outputdir/.tmp" mkdir -p "$outputdir/.tmp" -rm -f "$outputdir/.tmp/win_ids" mkfifo "$outputdir/.tmp/win_ids" || exit 1 afl-plot-ui > "$outputdir/.tmp/win_ids" & W_IDS=$(cat "$outputdir/.tmp/win_ids") -rm -f "$outputdir/.tmp/win_ids" -if [ -z "$(ls -A $outputdir/.tmp)" ]; then - rm -rf "$outputdir/.tmp" -fi +rm -rf "$outputdir/.tmp" -W_ID1=$(echo "$W_IDS" | head -1) -W_ID2=$(echo "$W_IDS" | head -2 | tail -1) -W_ID3=$(echo "$W_IDS" | head -3 | tail -1) -W_ID4=$(echo "$W_IDS" | tail -1) +W_ID1=$(echo "$W_IDS" | head -n 1) +W_ID2=$(echo "$W_IDS" | head -n 2 | tail -n 1) +W_ID3=$(echo "$W_IDS" | head -n 3 | tail -n 1) +W_ID4=$(echo "$W_IDS" | tail -n 1) echo "[*] Generating plots..." -- cgit 1.4.1