mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-06 09:00:55 +00:00
trivial: Ignore the return value of setenv() in most cases
This makes Coverity happy.
This commit is contained in:
parent
0f8dffd042
commit
0b7af7d54b
@ -592,7 +592,7 @@ fwupd_client_remotes_func(void)
|
||||
g_autoptr(GPtrArray) array = NULL;
|
||||
|
||||
remotesdir = g_test_build_filename(G_TEST_DIST, "tests", "remotes.d", NULL);
|
||||
g_setenv("FU_SELF_TEST_REMOTES_DIR", remotesdir, TRUE);
|
||||
(void)g_setenv("FU_SELF_TEST_REMOTES_DIR", remotesdir, TRUE);
|
||||
|
||||
client = fwupd_client_new();
|
||||
|
||||
@ -916,7 +916,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/fwupd/enums", fwupd_enums_func);
|
||||
|
@ -15,7 +15,7 @@ LLVMFuzzerTestOneInput(const guint8 *data, gsize size)
|
||||
g_autoptr(GBytes) fw = g_bytes_new(data, size);
|
||||
gboolean ret;
|
||||
|
||||
g_setenv("G_DEBUG", "fatal-criticals", FALSE);
|
||||
(void)g_setenv("G_DEBUG", "fatal-criticals", FALSE);
|
||||
ret = fu_firmware_parse(firmware, fw, FWUPD_INSTALL_FLAG_NONE, NULL);
|
||||
if (!ret && fu_firmware_has_flag(firmware, FU_FIRMWARE_FLAG_HAS_CHECKSUM)) {
|
||||
g_clear_object(&firmware);
|
||||
|
@ -358,7 +358,7 @@ fu_smbios_func(void)
|
||||
|
||||
/* these tests will not write */
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", NULL);
|
||||
g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
|
||||
smbios = fu_smbios_new();
|
||||
ret = fu_smbios_setup(smbios, &error);
|
||||
@ -633,7 +633,7 @@ fu_hwids_func(void)
|
||||
|
||||
/* these tests will not write */
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", NULL);
|
||||
g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
|
||||
smbios = fu_smbios_new();
|
||||
ret = fu_smbios_setup(smbios, &error);
|
||||
@ -888,17 +888,17 @@ fu_common_kernel_lockdown_func(void)
|
||||
#endif
|
||||
|
||||
old_kernel_dir = g_test_build_filename(G_TEST_DIST, "tests", "lockdown", NULL);
|
||||
g_setenv("FWUPD_SYSFSSECURITYDIR", old_kernel_dir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSSECURITYDIR", old_kernel_dir, TRUE);
|
||||
ret = fu_common_kernel_locked_down();
|
||||
g_assert_false(ret);
|
||||
|
||||
locked_dir = g_test_build_filename(G_TEST_DIST, "tests", "lockdown", "locked", NULL);
|
||||
g_setenv("FWUPD_SYSFSSECURITYDIR", locked_dir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSSECURITYDIR", locked_dir, TRUE);
|
||||
ret = fu_common_kernel_locked_down();
|
||||
g_assert_true(ret);
|
||||
|
||||
none_dir = g_test_build_filename(G_TEST_DIST, "tests", "lockdown", "none", NULL);
|
||||
g_setenv("FWUPD_SYSFSSECURITYDIR", none_dir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSSECURITYDIR", none_dir, TRUE);
|
||||
ret = fu_common_kernel_locked_down();
|
||||
g_assert_false(ret);
|
||||
}
|
||||
@ -3124,7 +3124,7 @@ fu_efivar_func(void)
|
||||
|
||||
/* these tests will write */
|
||||
sysfsfwdir = g_test_build_filename(G_TEST_BUILT, "tests", NULL);
|
||||
g_setenv("FWUPD_SYSFSFWDIR", sysfsfwdir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWDIR", sysfsfwdir, TRUE);
|
||||
|
||||
/* check supported */
|
||||
ret = fu_efivar_supported(&error);
|
||||
@ -3950,14 +3950,14 @@ main(int argc, char **argv)
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", NULL);
|
||||
g_setenv("FWUPD_DATADIR", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_PLUGINDIR", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_SYSCONFDIR", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_OFFLINE_TRIGGER", "/tmp/fwupd-self-test/system-update", TRUE);
|
||||
g_setenv("FWUPD_LOCALSTATEDIR", "/tmp/fwupd-self-test/var", TRUE);
|
||||
(void)g_setenv("FWUPD_DATADIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGINDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSCONFDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_OFFLINE_TRIGGER", "/tmp/fwupd-self-test/system-update", TRUE);
|
||||
(void)g_setenv("FWUPD_LOCALSTATEDIR", "/tmp/fwupd-self-test/var", TRUE);
|
||||
|
||||
g_test_add_func("/fwupd/common{strnsplit}", fu_common_strnsplit_func);
|
||||
g_test_add_func("/fwupd/common{memmem}", fu_common_memmem_func);
|
||||
|
@ -63,7 +63,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/acpi-dmar/opt-in", fu_acpi_dmar_opt_in_func);
|
||||
|
@ -63,7 +63,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/acpi-facp/s2i{disabled}", fu_acpi_facp_s2i_disabled_func);
|
||||
|
@ -64,7 +64,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/acpi-ivrs/dma-remap-support", fu_acpi_ivrs_dma_remap_func);
|
||||
|
@ -42,7 +42,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/acpi-phat/parse", fu_acpi_phat_parse_func);
|
||||
|
@ -871,9 +871,9 @@ fu_plugin_dell_init(FuPlugin *plugin)
|
||||
|
||||
data->smi_obj = g_malloc0(sizeof(FuDellSmiObj));
|
||||
if (g_getenv("FWUPD_DELL_VERBOSE") != NULL)
|
||||
g_setenv("LIBSMBIOS_C_DEBUG_OUTPUT_ALL", "1", TRUE);
|
||||
(void)g_setenv("LIBSMBIOS_C_DEBUG_OUTPUT_ALL", "1", TRUE);
|
||||
else
|
||||
g_setenv("TSS2_LOG", "esys+none,tcti+none", FALSE);
|
||||
(void)g_setenv("TSS2_LOG", "esys+none,tcti+none", FALSE);
|
||||
if (fu_dell_supported(plugin))
|
||||
data->smi_obj->smi = dell_smi_factory(DELL_SMI_DEFAULTS);
|
||||
data->smi_obj->fake_smbios = FALSE;
|
||||
|
@ -566,13 +566,13 @@ main(int argc, char **argv)
|
||||
|
||||
/* change path */
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", NULL);
|
||||
g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
|
||||
/* change behavior */
|
||||
sysfsdir = fu_common_get_path(FU_PATH_KIND_SYSFSDIR_FW);
|
||||
g_setenv("FWUPD_UEFI_ESP_PATH", sysfsdir, TRUE);
|
||||
g_setenv("FWUPD_UEFI_TEST", "1", TRUE);
|
||||
g_setenv("FWUPD_DELL_FAKE_SMBIOS", "1", FALSE);
|
||||
(void)g_setenv("FWUPD_UEFI_ESP_PATH", sysfsdir, TRUE);
|
||||
(void)g_setenv("FWUPD_UEFI_TEST", "1", TRUE);
|
||||
(void)g_setenv("FWUPD_DELL_FAKE_SMBIOS", "1", FALSE);
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
|
@ -158,7 +158,7 @@ main(int argc, char **argv)
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
|
||||
/* log everything */
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/dfu/enums", fu_dfu_enums_func);
|
||||
|
@ -832,7 +832,7 @@ main(int argc, char *argv[])
|
||||
|
||||
/* set verbose? */
|
||||
if (verbose)
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
|
||||
/* version */
|
||||
if (version) {
|
||||
|
@ -96,7 +96,7 @@ fu_plugin_lenovo_thinklmi_bootorder_locked(gconstpointer user_data)
|
||||
g_autoptr(FuDevice) dev = NULL;
|
||||
g_autofree gchar *test_dir =
|
||||
g_test_build_filename(G_TEST_DIST, "tests", "firmware-attributes", "locked", NULL);
|
||||
g_setenv("FWUPD_SYSFSFWATTRIBDIR", test_dir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWATTRIBDIR", test_dir, TRUE);
|
||||
|
||||
dev = fu_test_probe_fake_esrt(self);
|
||||
fu_plugin_runner_device_register(self->plugin_lenovo_thinklmi, dev);
|
||||
@ -110,7 +110,7 @@ fu_plugin_lenovo_thinklmi_bootorder_unlocked(gconstpointer user_data)
|
||||
g_autoptr(FuDevice) dev = NULL;
|
||||
g_autofree gchar *test_dir =
|
||||
g_test_build_filename(G_TEST_DIST, "tests", "firmware-attributes", "unlocked", NULL);
|
||||
g_setenv("FWUPD_SYSFSFWATTRIBDIR", test_dir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWATTRIBDIR", test_dir, TRUE);
|
||||
|
||||
dev = fu_test_probe_fake_esrt(self);
|
||||
fu_plugin_runner_device_register(self->plugin_lenovo_thinklmi, dev);
|
||||
@ -145,16 +145,16 @@ main(int argc, char **argv)
|
||||
/* starting thinklmi dir to make startup pass */
|
||||
test_dir =
|
||||
g_test_build_filename(G_TEST_DIST, "tests", "firmware-attributes", "locked", NULL);
|
||||
g_setenv("FWUPD_SYSFSFWATTRIBDIR", test_dir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWATTRIBDIR", test_dir, TRUE);
|
||||
|
||||
/* starting ESRT path */
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", NULL);
|
||||
g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
|
||||
/* change behavior of UEFI plugin for test mode */
|
||||
sysfsdir = fu_common_get_path(FU_PATH_KIND_SYSFSDIR_FW);
|
||||
g_setenv("FWUPD_UEFI_ESP_PATH", sysfsdir, TRUE);
|
||||
g_setenv("FWUPD_UEFI_TEST", "1", TRUE);
|
||||
(void)g_setenv("FWUPD_UEFI_ESP_PATH", sysfsdir, TRUE);
|
||||
(void)g_setenv("FWUPD_UEFI_TEST", "1", TRUE);
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
|
@ -75,7 +75,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/linux-swap/none", fu_linux_swap_none_func);
|
||||
|
@ -81,7 +81,7 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
g_setenv("FWUPD_MTD_VERBOSE", "1", TRUE);
|
||||
(void)g_setenv("FWUPD_MTD_VERBOSE", "1", TRUE);
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_test_add_func("/mtd/device", fu_test_mtd_device_func);
|
||||
return g_test_run();
|
||||
|
@ -375,13 +375,13 @@ main(int argc, char **argv)
|
||||
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
|
||||
g_setenv("FWUPD_REDFISH_VERBOSE", "1", TRUE);
|
||||
(void)g_setenv("FWUPD_REDFISH_VERBOSE", "1", TRUE);
|
||||
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", NULL);
|
||||
smbios_data_fn = g_build_filename(testdatadir, "redfish-smbios.bin", NULL);
|
||||
g_setenv("FWUPD_REDFISH_SMBIOS_DATA", smbios_data_fn, TRUE);
|
||||
g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
g_setenv("CONFIGURATION_DIRECTORY", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_REDFISH_SMBIOS_DATA", smbios_data_fn, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("CONFIGURATION_DIRECTORY", testdatadir, TRUE);
|
||||
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
fu_test_self_init(self);
|
||||
|
@ -85,7 +85,7 @@ fu_tpm_device_2_0_func(void)
|
||||
g_autoptr(GPtrArray) pcr0s = NULL;
|
||||
g_autoptr(GPtrArray) pcrXs = NULL;
|
||||
const gchar *tpm_server_running = g_getenv("TPM_SERVER_RUNNING");
|
||||
g_setenv("FWUPD_FORCE_TPM2", "1", TRUE);
|
||||
(void)g_setenv("FWUPD_FORCE_TPM2", "1", TRUE);
|
||||
|
||||
#ifdef HAVE_GETUID
|
||||
if (tpm_server_running == NULL && (getuid() != 0 || geteuid() != 0)) {
|
||||
@ -207,7 +207,7 @@ fu_tpm_empty_pcr_func(void)
|
||||
/* save environment and set broken PCR data */
|
||||
environ_old = g_get_environ();
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", "empty_pcr", NULL);
|
||||
g_setenv("FWUPD_SYSFSTPMDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSTPMDIR", testdatadir, TRUE);
|
||||
|
||||
/* load the plugin */
|
||||
pluginfn = g_test_build_filename(G_TEST_BUILT, "libfu_plugin_tpm." G_MODULE_SUFFIX, NULL);
|
||||
@ -228,7 +228,9 @@ fu_tpm_empty_pcr_func(void)
|
||||
FWUPD_SECURITY_ATTR_RESULT_NOT_VALID);
|
||||
|
||||
/* restore default environment */
|
||||
g_setenv("FWUPD_SYSFSTPMDIR", g_environ_getenv(environ_old, "FWUPD_SYSFSTPMDIR"), TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSTPMDIR",
|
||||
g_environ_getenv(environ_old, "FWUPD_SYSFSTPMDIR"),
|
||||
TRUE);
|
||||
}
|
||||
|
||||
int
|
||||
@ -239,12 +241,12 @@ main(int argc, char **argv)
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", NULL);
|
||||
g_setenv("FWUPD_SYSFSTPMDIR", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_UEFI_TEST", "1", TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSTPMDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_UEFI_TEST", "1", TRUE);
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/tpm/pcrs1.2", fu_tpm_device_1_2_func);
|
||||
|
@ -140,8 +140,8 @@ main(int argc, char *argv[])
|
||||
|
||||
/* set verbose? */
|
||||
if (verbose) {
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
g_setenv("FWUPD_TPM_EVENTLOG_VERBOSE", "1", FALSE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
(void)g_setenv("FWUPD_TPM_EVENTLOG_VERBOSE", "1", FALSE);
|
||||
}
|
||||
|
||||
/* allow user to chose a local file */
|
||||
|
@ -249,7 +249,7 @@ fu_tpm_v2_device_setup(FuDevice *device, GError **error)
|
||||
|
||||
/* suppress warning messages about missing TCTI libraries for tpm2-tss <2.3 */
|
||||
if (g_getenv("FWUPD_UEFI_VERBOSE") == NULL)
|
||||
g_setenv("TSS2_LOG", "esys+none,tcti+none", FALSE);
|
||||
(void)g_setenv("TSS2_LOG", "esys+none,tcti+none", FALSE);
|
||||
|
||||
/* setup TSS */
|
||||
rc = Esys_Initialize(&ctx, NULL, NULL);
|
||||
|
@ -287,13 +287,13 @@ main(int argc, char **argv)
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", NULL);
|
||||
g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_SYSFSDRIVERDIR", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_UEFI_TEST", "1", TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSDRIVERDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_UEFI_TEST", "1", TRUE);
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/uefi/bgrt", fu_uefi_bgrt_func);
|
||||
|
@ -214,7 +214,7 @@ main(int argc, char *argv[])
|
||||
|
||||
/* set verbose? */
|
||||
if (verbose) {
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
} else {
|
||||
g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, fu_util_ignore_cb, NULL);
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ main(int argc, char *argv[])
|
||||
|
||||
/* set verbose? */
|
||||
if (verbose) {
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
} else {
|
||||
g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, fu_util_ignore_cb, NULL);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/uefi-dbx/image", fu_efi_image_func);
|
||||
|
@ -97,7 +97,7 @@ main(int argc, char **argv)
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
|
||||
/* log everything */
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func("/wac/firmware{parse}", fu_wac_firmware_parse_func);
|
||||
|
@ -190,7 +190,7 @@ fu_config_reload(FuConfig *self, GError **error)
|
||||
/* get the domains to run in verbose */
|
||||
domains = g_key_file_get_string(keyfile, "fwupd", "VerboseDomains", NULL);
|
||||
if (domains != NULL && domains[0] != '\0')
|
||||
g_setenv("FWUPD_VERBOSE", domains, TRUE);
|
||||
(void)g_setenv("FWUPD_VERBOSE", domains, TRUE);
|
||||
|
||||
/* whether to update the motd on changes */
|
||||
self->update_motd =
|
||||
|
@ -196,10 +196,10 @@ fu_debug_post_parse_hook(GOptionContext *context,
|
||||
|
||||
/* verbose? */
|
||||
if (self->verbose) {
|
||||
g_setenv("FWUPD_VERBOSE", "*", TRUE);
|
||||
(void)g_setenv("FWUPD_VERBOSE", "*", TRUE);
|
||||
} else if (self->daemon_verbose != NULL) {
|
||||
g_autofree gchar *str = g_strjoinv(",", self->daemon_verbose);
|
||||
g_setenv("FWUPD_VERBOSE", str, TRUE);
|
||||
(void)g_setenv("FWUPD_VERBOSE", str, TRUE);
|
||||
}
|
||||
|
||||
/* redirect all domains to be able to change FWUPD_VERBOSE at runtime */
|
||||
@ -219,7 +219,7 @@ fu_debug_post_parse_hook(GOptionContext *context,
|
||||
name_caps = g_ascii_strup(self->plugin_verbose[i], -1);
|
||||
varname = g_strdup_printf("FWUPD_%s_VERBOSE", name_caps);
|
||||
g_debug("setting %s=1", varname);
|
||||
g_setenv(varname, "1", TRUE);
|
||||
(void)g_setenv(varname, "1", TRUE);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -1903,7 +1903,7 @@ fu_engine_history_func(gconstpointer user_data)
|
||||
g_assert_nonnull(component);
|
||||
|
||||
/* set the counter */
|
||||
g_setenv("FWUPD_PLUGIN_TEST", "another-write-required", TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGIN_TEST", "another-write-required", TRUE);
|
||||
fu_device_set_metadata_integer(device, "nr-update", 0);
|
||||
|
||||
/* install it */
|
||||
@ -2126,7 +2126,7 @@ fu_engine_history_inherit(gconstpointer user_data)
|
||||
fu_engine_set_silo(engine, silo_empty);
|
||||
|
||||
/* set up dummy plugin */
|
||||
g_setenv("FWUPD_PLUGIN_TEST", "fail", TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGIN_TEST", "fail", TRUE);
|
||||
fu_engine_add_plugin(engine, self->plugin);
|
||||
ret = fu_engine_load(engine, FU_ENGINE_LOAD_FLAG_NO_CACHE, &error);
|
||||
g_assert_no_error(error);
|
||||
@ -2170,7 +2170,7 @@ fu_engine_history_inherit(gconstpointer user_data)
|
||||
g_assert_nonnull(component);
|
||||
|
||||
/* install it */
|
||||
g_setenv("FWUPD_PLUGIN_TEST", "requires-activation", TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGIN_TEST", "requires-activation", TRUE);
|
||||
fu_release_set_device(release, device);
|
||||
ret = fu_release_load(release, component, NULL, FWUPD_INSTALL_FLAG_NONE, &error);
|
||||
g_assert_no_error(error);
|
||||
@ -2266,7 +2266,7 @@ fu_engine_install_needs_reboot(gconstpointer user_data)
|
||||
fu_engine_set_silo(engine, silo_empty);
|
||||
|
||||
/* set up dummy plugin */
|
||||
g_setenv("FWUPD_PLUGIN_TEST", "fail", TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGIN_TEST", "fail", TRUE);
|
||||
fu_engine_add_plugin(engine, self->plugin);
|
||||
ret = fu_engine_load(engine, FU_ENGINE_LOAD_FLAG_NONE, &error);
|
||||
g_assert_no_error(error);
|
||||
@ -2310,7 +2310,7 @@ fu_engine_install_needs_reboot(gconstpointer user_data)
|
||||
g_assert_nonnull(component);
|
||||
|
||||
/* install it */
|
||||
g_setenv("FWUPD_PLUGIN_TEST", "requires-reboot", TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGIN_TEST", "requires-reboot", TRUE);
|
||||
fu_release_set_device(release, device);
|
||||
ret = fu_release_load(release, component, NULL, FWUPD_INSTALL_FLAG_NONE, &error);
|
||||
g_assert_no_error(error);
|
||||
@ -2357,7 +2357,7 @@ fu_engine_history_error_func(gconstpointer user_data)
|
||||
fu_engine_set_silo(engine, silo_empty);
|
||||
|
||||
/* set up dummy plugin */
|
||||
g_setenv("FWUPD_PLUGIN_TEST", "fail", TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGIN_TEST", "fail", TRUE);
|
||||
fu_engine_add_plugin(engine, self->plugin);
|
||||
ret = fu_engine_load(engine, FU_ENGINE_LOAD_FLAG_NO_CACHE, &error);
|
||||
g_assert_no_error(error);
|
||||
@ -3087,7 +3087,7 @@ fu_plugin_module_func(gconstpointer user_data)
|
||||
fu_engine_set_silo(engine, silo_empty);
|
||||
|
||||
/* create a fake device */
|
||||
g_setenv("FWUPD_PLUGIN_TEST", "registration", TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGIN_TEST", "registration", TRUE);
|
||||
ret = fu_plugin_runner_startup(self->plugin, &error);
|
||||
g_assert_no_error(error);
|
||||
g_assert_true(ret);
|
||||
@ -3479,7 +3479,7 @@ fu_plugin_composite_func(gconstpointer user_data)
|
||||
g_assert_cmpint(components->len, ==, 3);
|
||||
|
||||
/* set up dummy plugin */
|
||||
g_setenv("FWUPD_PLUGIN_TEST", "composite", TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGIN_TEST", "composite", TRUE);
|
||||
fu_engine_add_plugin(engine, self->plugin);
|
||||
|
||||
ret = fu_plugin_runner_startup(self->plugin, &error);
|
||||
@ -3846,16 +3846,16 @@ main(int argc, char **argv)
|
||||
|
||||
/* only critical and error are fatal */
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
g_setenv("FWUPD_DEVICE_LIST_VERBOSE", "1", TRUE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
(void)g_setenv("FWUPD_DEVICE_LIST_VERBOSE", "1", TRUE);
|
||||
testdatadir = g_test_build_filename(G_TEST_DIST, "tests", NULL);
|
||||
g_setenv("FWUPD_DATADIR", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_PLUGINDIR", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_SYSCONFDIR", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
g_setenv("CONFIGURATION_DIRECTORY", testdatadir, TRUE);
|
||||
g_setenv("FWUPD_OFFLINE_TRIGGER", "/tmp/fwupd-self-test/system-update", TRUE);
|
||||
g_setenv("FWUPD_LOCALSTATEDIR", "/tmp/fwupd-self-test/var", TRUE);
|
||||
(void)g_setenv("FWUPD_DATADIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_PLUGINDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSCONFDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_SYSFSFWDIR", testdatadir, TRUE);
|
||||
(void)g_setenv("CONFIGURATION_DIRECTORY", testdatadir, TRUE);
|
||||
(void)g_setenv("FWUPD_OFFLINE_TRIGGER", "/tmp/fwupd-self-test/system-update", TRUE);
|
||||
(void)g_setenv("FWUPD_LOCALSTATEDIR", "/tmp/fwupd-self-test/var", TRUE);
|
||||
|
||||
/* ensure empty tree */
|
||||
fu_self_test_mkroot();
|
||||
|
@ -3356,7 +3356,7 @@ main(int argc, char *argv[])
|
||||
|
||||
#ifdef _WIN32
|
||||
/* workaround Windows setting the codepage to 1252 */
|
||||
g_setenv("LANG", "C.UTF-8", FALSE);
|
||||
(void)g_setenv("LANG", "C.UTF-8", FALSE);
|
||||
#endif
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
@ -3714,7 +3714,7 @@ main(int argc, char *argv[])
|
||||
_("Ignoring SSL strict checks, "
|
||||
"to do this automatically in the future "
|
||||
"export DISABLE_SSL_STRICT in your environment"));
|
||||
g_setenv("DISABLE_SSL_STRICT", "1", TRUE);
|
||||
(void)g_setenv("DISABLE_SSL_STRICT", "1", TRUE);
|
||||
}
|
||||
|
||||
/* parse filter flags */
|
||||
|
@ -4301,7 +4301,7 @@ main(int argc, char *argv[])
|
||||
_("Ignoring SSL strict checks, "
|
||||
"to do this automatically in the future "
|
||||
"export DISABLE_SSL_STRICT in your environment"));
|
||||
g_setenv("DISABLE_SSL_STRICT", "1", TRUE);
|
||||
(void)g_setenv("DISABLE_SSL_STRICT", "1", TRUE);
|
||||
}
|
||||
|
||||
/* this doesn't have to be precise (e.g. using the build-year) as we just
|
||||
@ -4347,8 +4347,8 @@ main(int argc, char *argv[])
|
||||
|
||||
/* set verbose? */
|
||||
if (verbose) {
|
||||
g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
g_setenv("FWUPD_VERBOSE", "1", FALSE);
|
||||
(void)g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
|
||||
(void)g_setenv("FWUPD_VERBOSE", "1", FALSE);
|
||||
} else {
|
||||
g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, fu_util_ignore_cb, NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user