]> xenbits.xensource.com Git - libvirt.git/commitdiff
Add debug for envp[] in virExecWithHook()
authorAmy Griffis <amy.griffis@hp.com>
Thu, 8 Oct 2009 15:11:03 +0000 (17:11 +0200)
committerDaniel Veillard <veillard@redhat.com>
Thu, 8 Oct 2009 15:11:03 +0000 (17:11 +0200)
* src/util/util.c: output some debug if caller of virExecWithHook have
  set envp[]

src/util/util.c

index 81b743c95ce57199e7fa6abf52741c2bfa58fb97..e5135fc3870f7dfd18e827203b42d618c50f8e04 100644 (file)
@@ -601,12 +601,23 @@ virExecWithHook(virConnectPtr conn,
                 char *pidfile)
 {
     char *argv_str;
+    char *envp_str;
 
     if ((argv_str = virArgvToString(argv)) == NULL) {
         virReportOOMError(conn);
         return -1;
     }
-    DEBUG0(argv_str);
+
+    if (envp) {
+        if ((envp_str = virArgvToString(envp)) == NULL) {
+            virReportOOMError(conn);
+            return -1;
+        }
+        VIR_DEBUG("%s %s", envp_str, argv_str);
+        VIR_FREE(envp_str);
+    } else {
+        VIR_DEBUG0(argv_str);
+    }
     VIR_FREE(argv_str);
 
     return __virExec(conn, argv, envp, keepfd, retpid, infd, outfd, errfd,