GNOME Bugzilla – Bug 108574
PATCH: using xmlDocDump is unreliable
Last modified: 2004-12-22 21:47:04 UTC
I had this problem with bonobo-conf in Evolution (thank god we are not using that anymore) but I just checked GConf and it suffers from the same problem. libxml's file saving routines are not sufficiently reliable for user data. see http://bugzilla.gnome.org/show_bug.cgi?id=108329 for further details (finally got around to digging into libxml2's src to see if it was still a problem, and it is...) attached is a simple patch that works around the bug in libxml
Created attachment 15064 [details] [review] xml-backend.patch
*poke* users on evolution@ximian.com are starting to rally with their tar and feathers. we need this reviewed/applied ASAP :-)
It looks fine to commit, thanks. My only complaint is this code which could at least use a comment justifying it, it looks like "try everything because we aren't sure how the API really works": + if (fflush (fp) != 0) + return -1; + + if ((fd = fileno (fp)) == -1) + return -1; + + if (fsync (fd) == -1) + return -1;
sure thing. added the following comment: /* From the fflush(3) man page: * * Note that fflush() only flushes the user space buffers provided by the * C library. To ensure that the data is physically stored on disk the * kernel buffers must be flushed too, e.g. with sync(2) or fsync(2). */ committed to both gnome-2-2 branch and trunk (if we need this to go into any other branches, lemme know)