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



commit ee0d2604d41bc8feb3730c0f429ca075bbf312fc
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 f4be19a..b68cdf2 100644
--- a/plugins/color/gcm-dmi.c
+++ b/plugins/color/gcm-dmi.c
@@ -122,6 +122,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",
@@ -136,6 +137,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]