[libvirt] [PATCH 1/4] replace use of gnulib setenv by g_setenv
Pavel Hrdina
phrdina at redhat.com
Wed Nov 27 09:07:02 UTC 2019
On Tue, Nov 26, 2019 at 07:18:14PM -0500, Cole Robinson wrote:
> On 11/14/19 5:42 AM, Pavel Hrdina wrote:
> > Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> > ---
> > src/security/virt-aa-helper.c | 4 ++--
> > src/vbox/vbox_XPCOMCGlue.c | 2 +-
> > tests/libxlxml2domconfigtest.c | 4 ++--
> > tests/lxcxml2xmltest.c | 2 +-
> > tests/qemudomaincheckpointxml2xmltest.c | 2 +-
> > tests/qemudomainsnapshotxml2xmltest.c | 2 +-
> > tests/qemufirmwaretest.c | 2 +-
> > tests/qemuhotplugtest.c | 2 +-
> > tests/qemumemlocktest.c | 2 +-
> > tests/qemusecuritytest.c | 2 +-
> > tests/qemuvhostusertest.c | 2 +-
> > tests/qemuxml2argvtest.c | 14 +++++++-------
> > tests/qemuxml2xmltest.c | 4 ++--
> > tests/securityselinuxhelper.c | 4 ++--
> > tests/testutils.c | 6 +++---
> > tests/testutils.h | 4 ++--
> > tests/testutilsqemu.c | 2 +-
> > tests/vircgrouptest.c | 8 ++++----
> > tests/virfiletest.c | 2 +-
> > tests/virhostdevtest.c | 2 +-
> > tests/virnettlscontexttest.c | 2 +-
> > tests/virnettlssessiontest.c | 2 +-
> > tests/virpcitest.c | 2 +-
> > tests/virportallocatortest.c | 2 +-
> > tests/virsystemdtest.c | 18 +++++++++---------
> > tests/virtimetest.c | 4 ++--
> > tools/virt-login-shell-helper.c | 12 ++++++------
> > 27 files changed, 57 insertions(+), 57 deletions(-)
> >
> > diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
> > index 5ac9a9eeb8..12edc9c73f 100644
> > --- a/src/security/virt-aa-helper.c
> > +++ b/src/security/virt-aa-helper.c
> > @@ -1408,11 +1408,11 @@ main(int argc, char **argv)
> >
> > /* clear the environment */
> > environ = NULL;
> > - if (setenv("PATH", "/sbin:/usr/sbin", 1) != 0)
> > + if (g_setenv("PATH", "/sbin:/usr/sbin", 1) != 0)
> > vah_error(ctl, 1, _("could not set PATH"));
> >
> > /* ensure the traditional IFS setting */
> > - if (setenv("IFS", " \t\n", 1) != 0)
> > + if (g_setenv("IFS", " \t\n", 1) != 0)
> > vah_error(ctl, 1, _("could not set IFS"));
> >
>
> g_setenv returns gboolean, FALSE on failure. So these need to be
> adjusted to == FALSE, or !g_setenv. virt-aa-helper test is failing after
> this
>
> There's a few other instances of '< 0' checks which need to be adjusted
> too. With those fixed, for the series:
>
> Reviewed-by: Cole Robinson <crobinso at redhat.com>
>
> But probably for after freeze
Oh, nice catch, somehow I missed that fact from documentation. Thanks,
I'll fix it and push it after freeze.
Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20191127/649c5fb7/attachment-0001.sig>
More information about the libvir-list
mailing list