[clamav] clamav-notify-server: fixed compatibility with RHEL6 coreutils

ensc ensc at fedoraproject.org
Wed Jan 25 23:01:43 UTC 2012


commit dda88bd5f377f12e6d54c2fbd48332b1683a168f
Author: Enrico Scholz <enrico.scholz at sigma-chemnitz.de>
Date:   Tue Jan 24 13:02:14 2012 +0100

    clamav-notify-server: fixed compatibility with RHEL6 coreutils

 clamav-notify-servers |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/clamav-notify-servers b/clamav-notify-servers
index 8c298aa..4324ec3 100644
--- a/clamav-notify-servers
+++ b/clamav-notify-servers
@@ -23,6 +23,9 @@ NC=nc
 TIMEOUT_TERM=30
 TIMEOUT_KILL=60
 
+K_OPT=1
+LANG=C timeout --help | grep -q -- '--kill-after' || unset K_OPT
+
 get_sockets() {
     (
 	cd /etc/clamd.d
@@ -66,7 +69,7 @@ op_nc() {
 		continue
 	esac
 
-	resp=`printf 'zRELOAD\0' | timeout -k $TIMEOUT_KILL $TIMEOUT_TERM "${CMD[@]}"`
+	resp=`printf 'zRELOAD\0' | timeout ${K_OPT:+-k $TIMEOUT_KILL} $TIMEOUT_TERM "${CMD[@]}"`
 	case $resp in
 	  (RELOADING)
 		;;


More information about the scm-commits mailing list