[glib] gsettings tool: report failure to write



commit 8753df9d700dcc132f77432d76863884ab21fa87
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jul 19 19:41:24 2013 -0400

    gsettings tool: report failure to write
    
    If a key is locked down, we should report an error if we
    fail to write it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704424

 gio/gsettings-tool.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c
index 57beb7b..7d9c250 100644
--- a/gio/gsettings-tool.c
+++ b/gio/gsettings-tool.c
@@ -513,7 +513,11 @@ gsettings_set (GSettings   *settings,
       exit (1);
     }
 
-  g_settings_set_value (settings, key, new);
+  if (!g_settings_set_value (settings, key, new))
+    {
+      g_printerr (_("The key is not writable\n"));
+      exit (1);
+    }
 
   g_settings_sync ();
 


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