[1/2] initscripts: Fix wrong variable check for $PIDFILE in getpids

Message ID 20240111152108.4041802-1-michael.tremer@ipfire.org
State Staged
Commit dd8ef8cc107a867d4b2a739913b399f6966b34ff
Headers
Series [1/2] initscripts: Fix wrong variable check for $PIDFILE in getpids |

Commit Message

Michael Tremer Jan. 11, 2024, 3:21 p.m. UTC
  getpids() checked whether it needed to pass a pid file to pidofproc, but
the check was inverted.

Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org>
---
 src/initscripts/system/functions | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/src/initscripts/system/functions b/src/initscripts/system/functions
index 6f53a941b..e4cb30456 100644
--- a/src/initscripts/system/functions
+++ b/src/initscripts/system/functions
@@ -407,7 +407,7 @@  pidofproc()
 # This will ensure compatibility with previous LFS Bootscripts
 getpids()
 {
-	if [ -z "${PIDFILE}" ]; then
+	if [ -n "${PIDFILE}" ]; then
 		pidofproc -s -p "${PIDFILE}" $@
 	else
 		pidofproc -s $@