[libvirt] [PATCH] commandtest: avoid printing loader-control variables from commandhelper

Diego Elio Pettenò flameeyes at gmail.com
Thu Jan 6 20:23:36 UTC 2011


This avoids throwing the tests off if LD_LIBRARY_PATH or LD_PRELOAD or
other variables are set.

Signed-off-by: Diego Elio Pettenò <flameeyes at gmail.com>
---
 tests/commandhelper.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index f400e8d..398f002 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -81,7 +81,10 @@ int main(int argc, char **argv) {
     qsort(newenv, n, sizeof(newenv[0]), envsort);
 
     for (i = 0 ; i < n ; i++) {
-        fprintf(log, "ENV:%s\n", newenv[i]);
+        /* Ignore the variables used to instruct the loader into
+         * behaving differently, as they could throw the tests off. */
+        if ( strncmp(newenv[i], "LD_", 3) != 0 )
+            fprintf(log, "ENV:%s\n", newenv[i]);
     }
 
     for (i = 0 ; i < sysconf(_SC_OPEN_MAX) ; i++) {
-- 
1.7.4.rc1




More information about the libvir-list mailing list