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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]