[projects/rc-scripts] daemon: fix infinitive loop

glen glen at pld-linux.org
Mon May 18 15:09:19 CEST 2015


commit ff2643b0280e16b748866fd3eab1cf2c42ec7e39
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon May 18 16:08:28 2015 +0300

    daemon: fix infinitive loop
    
    currently sleep returns always true, so the loop is never broken

 lib/functions | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/lib/functions b/lib/functions
index 87eeb65..d7d5e9d 100644
--- a/lib/functions
+++ b/lib/functions
@@ -788,7 +788,8 @@ daemon() {
 			i=0
 			while [ "$i" -lt "$waittime" ]; do
 				i=$((i + 1))
-				checkpid $pid && sleep 1 || break
+				checkpid $pid && break
+				sleep 1
 			done
 		fi
 		log_success "$1 startup"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/ff2643b0280e16b748866fd3eab1cf2c42ec7e39



More information about the pld-cvs-commit mailing list