mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
Merge branch 'coverity-fix' into 'main'
gtestutils: Check for failure to setenv() and return See merge request GNOME/glib!3132
This commit is contained in:
commit
ded3099afc
@ -1684,7 +1684,12 @@ void
|
||||
g_free (tmpl);
|
||||
|
||||
/* Propagate the temporary directory to subprocesses. */
|
||||
g_setenv ("G_TEST_TMPDIR", test_isolate_dirs_tmpdir, TRUE);
|
||||
if (!g_setenv ("G_TEST_TMPDIR", test_isolate_dirs_tmpdir, TRUE))
|
||||
{
|
||||
g_printerr ("%s: Failed to set environment variable ‘%s’\n",
|
||||
(*argv)[0], "G_TEST_TMPDIR");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* And clear the traditional environment variables so subprocesses
|
||||
* spawned by the code under test can’t trash anything. If a test
|
||||
@ -1710,7 +1715,14 @@ void
|
||||
gsize i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (overridden_environment_variables); i++)
|
||||
g_setenv (overridden_environment_variables[i], "/dev/null", TRUE);
|
||||
{
|
||||
if (!g_setenv (overridden_environment_variables[i], "/dev/null", TRUE))
|
||||
{
|
||||
g_printerr ("%s: Failed to set environment variable ‘%s’\n",
|
||||
(*argv)[0], overridden_environment_variables[i]);
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user