[glib/wip/lantw/use-uname-as-a-fallback-to-get-os-info: 2/3] gutils: Only use the default OS name on Linux
- From: Ting-Wei Lan <lantw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/lantw/use-uname-as-a-fallback-to-get-os-info: 2/3] gutils: Only use the default OS name on Linux
- Date: Sun, 13 Oct 2019 13:56:54 +0000 (UTC)
commit e57c2ecbd43fe2d51fb1d672e9c54fb758ec8dc6
Author: Ting-Wei Lan <lantw src gnome org>
Date: Sun Oct 13 17:36:57 2019 +0800
gutils: Only use the default OS name on Linux
/etc/os-release is a spec designed for Linux. While other OSes can
implement it, it doesn't make sense to use Linux as the default value
on systems which don't use Linux.
glib/gutils.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/glib/gutils.c b/glib/gutils.c
index 4b3ec6b1f..da897bb08 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -1222,6 +1222,7 @@ g_get_os_info (const gchar *key_name)
g_strfreev (lines);
g_free (prefix);
+#ifdef __linux__
/* Default values in spec */
if (result == NULL)
{
@@ -1232,6 +1233,7 @@ g_get_os_info (const gchar *key_name)
if (g_str_equal (key_name, G_OS_INFO_KEY_PRETTY_NAME))
return g_strdup ("Linux");
}
+#endif
return g_steal_pointer (&result);
#elif defined (G_OS_WIN32)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]