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

gEDA-cvs: gaf.git: branch: master updated (1.6.0-20091004-12-ge1c4dab)



The branch, master has been updated
       via  e1c4dab66eea9b253b3be4e006e4ab741b62024e (commit)
      from  e9355f593ea77d83211f058f6a38b23b3a2a3243 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 libgeda/src/a_basic.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)


=================
 Commit Messages
=================

commit e1c4dab66eea9b253b3be4e006e4ab741b62024e
Author: Jason Childs <oblivian@xxxxxxxxxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: Use g_file_set_contents() to write files atomically.
    
    (One half of patch #2628677; crediting Jason because this part of
    the patch was applied unmodified. -- Peter)

:100644 100644 0c41d88... dc33cf6... M	libgeda/src/a_basic.c

=========
 Changes
=========

commit e1c4dab66eea9b253b3be4e006e4ab741b62024e
Author: Jason Childs <oblivian@xxxxxxxxxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    libgeda: Use g_file_set_contents() to write files atomically.
    
    (One half of patch #2628677; crediting Jason because this part of
    the patch was applied unmodified. -- Peter)

diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
index 0c41d88..dc33cf6 100644
--- a/libgeda/src/a_basic.c
+++ b/libgeda/src/a_basic.c
@@ -222,23 +222,16 @@ gchar *o_save_objects (const GList *object_list, gboolean save_attribs)
 int o_save (TOPLEVEL *toplevel, const GList *object_list,
             const char *filename)
 {
-  FILE *fp;
   char *buffer;
-
-  fp = fopen(filename, "wb");
-
-  if (fp == NULL) {
-    s_log_message(_("o_save: Could not open [%s]\n"), filename);
-    return 0;
-  }
+  GError *err = NULL;
 
   buffer = o_save_buffer (toplevel, object_list);
-  if (fwrite (buffer, strlen(buffer), 1, fp) != 1) {
-    /* An error occurred with fwrite */
-#warning FIXME: What do we do?
+  if (!g_file_set_contents (filename, buffer, strlen(buffer), &err)) {
+    g_free (buffer);
+    g_error_free (err);
+    return 0;
   }
   g_free (buffer);
-  fclose (fp);
 
   return 1;
 }




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs