mirror of
https://github.com/osmarks/ngircd.git
synced 2024-10-27 20:36:18 +00:00
Test suite: Don't use "pgrep -u" when LOGNAME and USER are not set
Thanks for reporting this on IRC, luca!
This commit is contained in:
parent
b362b5a945
commit
a33d15751b
@ -23,7 +23,13 @@ if [ -x /usr/bin/pgrep ]; then
|
|||||||
*)
|
*)
|
||||||
PGREP_FLAGS=""
|
PGREP_FLAGS=""
|
||||||
esac
|
esac
|
||||||
exec /usr/bin/pgrep $PGREP_FLAGS -n -u "${LOGNAME:-$USER}" "$1"
|
if [ -n "$LOGNAME" ] || [ -n "$USER" ]; then
|
||||||
|
# Try to narrow the search down to the current user ...
|
||||||
|
exec /usr/bin/pgrep $PGREP_FLAGS -n -u "${LOGNAME:-$USER}" "$1"
|
||||||
|
else
|
||||||
|
# ... but neither LOGNAME nor USER were set!
|
||||||
|
exec /usr/bin/pgrep $PGREP_FLAGS -n "$1"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pidof(1) could be a good alternative on elder Linux systems
|
# pidof(1) could be a good alternative on elder Linux systems
|
||||||
|
Loading…
Reference in New Issue
Block a user