while (*env_var_name) {
if (!getenv(*env_var_name)) {
if (cfg->verbose) {
- setenv(*env_var_name, "I", 1);
+ g_setenv(*env_var_name, "I", 1);
} else if (cfg->debug) {
- setenv(*env_var_name, "V", 1);
+ g_setenv(*env_var_name, "V", 1);
} else {
char val[2] = { 0 };
* explicitly specified.
*/
val[0] = cfg->log_level;
- setenv(*env_var_name, val, 1);
+ g_setenv(*env_var_name, val, 1);
}
}
#include <string.h>
#include <stdlib.h>
+#include <glib.h>
/*
* Note: Below implementation of timegm() is not thread safe
}
/* Temporarily setting TZ to 1 for UTC */
- setenv("TZ", "", 1);
+ g_setenv("TZ", "", 1);
tzset();
ret = mktime(tm);
if (tz) {
- setenv("TZ", tz, 1);
+ g_setenv("TZ", tz, 1);
free(tz);
} else {
unsetenv("TZ");
static enum bt_plugin_status plugin_init(struct bt_plugin *plugin)
{
- setenv("BT_TEST_PLUGIN_INIT_CALLED", "1", 1);
+ g_setenv("BT_TEST_PLUGIN_INIT_CALLED", "1", 1);
return BT_PLUGIN_STATUS_OK;
}
static enum bt_plugin_status plugin_exit(void)
{
- setenv("BT_TEST_PLUGIN_EXIT_CALLED", "1", 1);
+ g_setenv("BT_TEST_PLUGIN_EXIT_CALLED", "1", 1);
return BT_PLUGIN_STATUS_OK;
}
static void reset_test_plugin_env_vars(void)
{
- setenv("BT_TEST_PLUGIN_INIT_CALLED", "0", 1);
- setenv("BT_TEST_PLUGIN_EXIT_CALLED", "0", 1);
+ g_setenv("BT_TEST_PLUGIN_INIT_CALLED", "0", 1);
+ g_setenv("BT_TEST_PLUGIN_EXIT_CALLED", "0", 1);
}
static char *get_test_plugin_path(const char *plugin_dir,