[projects/rc-scripts] filter_chroot, exit early if no pids
glen
glen at pld-linux.org
Mon May 18 15:46:35 CEST 2015
commit 3a69d6346ff0f8a4698bccd523e7265d9af82a1f
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Mon May 18 16:46:05 2015 +0300
filter_chroot, exit early if no pids
this is optimization to lessen noise when debugging, not performance
optimize
lib/functions | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/lib/functions b/lib/functions
index 5d6dfbd..f337e82 100644
--- a/lib/functions
+++ b/lib/functions
@@ -498,6 +498,9 @@ checkpid() {
# (note: some processes like named are chrooted but run outside chroot)
# - do nothing inside vserver
filter_chroot() {
+ # no pids, exit early
+ [ $# -eq 0 ] && return
+
# filter by pid namespace if such dir exists for current process
# we do filter in containers as stacked containers are possible with LXC
if [ -d /proc/$$/ns ]; then
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/3a69d6346ff0f8a4698bccd523e7265d9af82a1f
More information about the pld-cvs-commit
mailing list