From eb3d6f97936dce487812464bda03de139a3eae8c Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Fri, 16 Apr 2021 08:27:31 +0900 Subject: [PATCH] include/inst: Make inst_stop emit a meaningful message upon error Instead of emitting a user-understandable error message, the inst_stop() function merely lets an error message from the sem module slip through. This commit changes the function to emit an error message that tells the caller why exactly the function failed. --- include/inst.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/inst.sh b/include/inst.sh index d20a8c5..8e900f5 100644 --- a/include/inst.sh +++ b/include/inst.sh @@ -91,7 +91,8 @@ inst_stop() { sem="$__inst_path/$pid" - if ! sem_post "$sem"; then + if ! sem_post "$sem" &> /dev/null; then + log_error "No such instance" return 1 fi -- 2.47.3