Re: [libvirt] [PATCH 3/7] Add debug for envp[] in virExecWithHook()

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

 



On Sun, Oct 04, 2009 at 03:28:54PM -0400, Amy Griffis wrote:
> Some callers may have set envp[].
> ---
> 
>  src/util/util.c |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/src/util/util.c b/src/util/util.c
> index 81b743c..e5135fc 100644
> --- a/src/util/util.c
> +++ b/src/util/util.c
> @@ -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,
> 

ACK


Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
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]