[gnome-settings-daemon] color plugin: prevent sysfs warning on !linux



commit 52b9ea0cf11aa72b8251fa11e99cc58054b9c81c
Author: Antoine Jacoutot <ajacoutot openbsd org>
Date:   Fri Dec 16 10:27:47 2011 +0100

    color plugin: prevent sysfs warning on !linux
    
    The /sys filesystem is only available on Linux, so there is no need to
    throw lots of warnings about /sys/class/dmi/... not being available on
    other OSes.
    https://bugzilla.gnome.org/show_bug.cgi?id=666350

 plugins/color/gcm-dmi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/plugins/color/gcm-dmi.c b/plugins/color/gcm-dmi.c
index 7e615ab..99d913f 100644
--- a/plugins/color/gcm-dmi.c
+++ b/plugins/color/gcm-dmi.c
@@ -121,6 +121,7 @@ gcm_dmi_class_init (GcmDmiClass *klass)
 static void
 gcm_dmi_init (GcmDmi *dmi)
 {
+#if defined(__linux__)
         const gchar *sysfs_name[] = {
                 "/sys/class/dmi/id/product_name",
                 "/sys/class/dmi/id/board_name",
@@ -135,6 +136,12 @@ gcm_dmi_init (GcmDmi *dmi)
                 "/sys/class/dmi/id/chassis_vendor",
                 "/sys/class/dmi/id/board_vendor",
                 NULL};
+#else
+#warning Please add dmi support for your OS
+        const gchar *sysfs_name[] = { NULL };
+        const gchar *sysfs_version[] = { NULL };
+        const gchar *sysfs_vendor[] = { NULL };
+#endif
 
         dmi->priv = GCM_DMI_GET_PRIVATE (dmi);
 



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