From 8d4e0d5260c9399b5697a3793f072d9b72833f7d Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 6 Sep 2014 15:08:28 +0200 Subject: [PATCH] util: Silence fwrite on error --- src/functions/functions.util | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/functions/functions.util b/src/functions/functions.util index 79ec87db..179656ea 100644 --- a/src/functions/functions.util +++ b/src/functions/functions.util @@ -135,7 +135,12 @@ function fwrite() { assert isset file shift - print "%s" "$@" >> ${file} + if [ ! -w "${file}" ]; then + log ERROR "${file}: No such file" + return ${EXIT_ERROR} + fi + + print "%s" "$@" >> ${file} 2>/dev/null } function enabled() { -- 2.47.3