[libosinfo 2/2] Use g_getenv() instead of getenv()

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

 



It's likely to be more portable
---
 osinfo/osinfo_loader.c | 2 +-
 test/test-mediauris.c  | 6 +++---
 test/test-treeuris.c   | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index e4dbef7..89bea31 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -1788,7 +1788,7 @@ void osinfo_loader_process_system_path(OsinfoLoader *loader,
 {
     GFile *file;
     gchar *dbdir;
-    const gchar *path = getenv("OSINFO_DATA_DIR");
+    const gchar *path = g_getenv("OSINFO_DATA_DIR");
     if (!path)
         path = PKG_DATA_DIR;
 
diff --git a/test/test-mediauris.c b/test/test-mediauris.c
index 191e8c6..cb876be 100644
--- a/test/test-mediauris.c
+++ b/test/test-mediauris.c
@@ -66,7 +66,7 @@ START_TEST(test_uris)
     GError *error = NULL;
     OsinfoOsList *oslist = NULL;
     GList *osel = NULL, *tmp;
-    gchar *debugstr;
+    const gchar *debugstr;
 
     session = soup_session_async_new_with_options(
 #ifdef HAVE_LIBSOUP_GNOME
@@ -74,7 +74,7 @@ START_TEST(test_uris)
                                                   SOUP_TYPE_PROXY_RESOLVER_GNOME,
 #endif
                                                   NULL);
-    if ((debugstr = getenv("LIBOSINFO_TEST_DEBUG"))) {
+    if ((debugstr = g_getenv("LIBOSINFO_TEST_DEBUG"))) {
         SoupLogger *logger;
         int debug_level = atoi(debugstr);
 
@@ -131,7 +131,7 @@ int main(void)
     Suite *s = list_suite ();
     SRunner *sr = srunner_create (s);
 
-    if (!getenv("LIBOSINFO_NETWORK_TESTS"))
+    if (!g_getenv("LIBOSINFO_NETWORK_TESTS"))
         return 77; /* Skip */
 
 #if !GLIB_CHECK_VERSION(2,35,1)
diff --git a/test/test-treeuris.c b/test/test-treeuris.c
index 07f14bf..d257004 100644
--- a/test/test-treeuris.c
+++ b/test/test-treeuris.c
@@ -66,7 +66,7 @@ START_TEST(test_uris)
     GError *error = NULL;
     OsinfoOsList *oslist = NULL;
     GList *osel = NULL, *tmp;
-    gchar *debugstr;
+    const gchar *debugstr;
 
     session = soup_session_async_new_with_options(
 #ifdef HAVE_LIBSOUP_GNOME
@@ -74,7 +74,7 @@ START_TEST(test_uris)
                                                   SOUP_TYPE_PROXY_RESOLVER_GNOME,
 #endif
                                                   NULL);
-    if ((debugstr = getenv("LIBOSINFO_TEST_DEBUG"))) {
+    if ((debugstr = g_getenv("LIBOSINFO_TEST_DEBUG"))) {
         SoupLogger *logger;
         int debug_level = atoi(debugstr);
 
@@ -131,7 +131,7 @@ int main(void)
     Suite *s = list_suite ();
     SRunner *sr = srunner_create (s);
 
-    if (!getenv("LIBOSINFO_NETWORK_TESTS"))
+    if (!g_getenv("LIBOSINFO_NETWORK_TESTS"))
         return 77; /* Skip */
 
 #if !GLIB_CHECK_VERSION(2,35,1)
-- 
1.8.1.4

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux