Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 16.09 33 lines 1.4 kB view raw
1From 6ad29ae97263060c9ec95856e0d8ab18409108c0 Mon Sep 17 00:00:00 2001 2From: Franz Pletz <fpletz@fnordicwalking.de> 3Date: Sat, 3 Sep 2016 05:45:36 +0200 4Subject: [PATCH] Set correct program name for sleep 5 6--- 7 src/password-store.sh | 7 +++++-- 8 1 file changed, 5 insertions(+), 2 deletions(-) 9 10diff --git a/src/password-store.sh b/src/password-store.sh 11index 63be840..ca47df3 100755 12--- a/src/password-store.sh 13+++ b/src/password-store.sh 14@@ -133,11 +133,14 @@ clip() { 15 # variable. Specifically, it cannot store nulls nor (non-trivally) store 16 # trailing new lines. 17 local sleep_argv0="password store sleep on display $DISPLAY" 18- pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 19+ pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 20 local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | base64)" 21 echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard" 22 ( 23- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) 24+ # Execute sleep as a child process of bash because it may be 25+ # a symlink to a single binary version of coreutils or busybox 26+ # which depends on argv0 correctly set to "sleep" 27+ ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") ) 28 local now="$(xclip -o -selection "$X_SELECTION" | base64)" 29 [[ $now != $(echo -n "$1" | base64) ]] && before="$now" 30 31-- 322.9.3 33