From: <tp...@ke...> - 2006-06-13 13:31:01
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: tpm Date: Tue Jun 13 2006 13:30:59 UTC Log message: * gst/gstregistryxml.c: (gst_registry_xml_write_cache): Fix silly bug that prevented us from creating ~/.gstreamer-0.10 and writing the registry in one go (the first call to g_mkstemp() would overwrite the placeholder in the template string, so the second call to g_mkstemp() after creating the missing directory would then error out with 'invalid argument'). Modified files: . : ChangeLog gst : gstregistryxml.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.2600&r2=1.2601 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstregistryxml.c.diff?r1=1.26&r2=1.27 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.2600 retrieving revision 1.2601 diff -u -d -r1.2600 -r1.2601 --- ChangeLog 13 Jun 2006 11:17:01 -0000 1.2600 +++ ChangeLog 13 Jun 2006 13:30:46 -0000 1.2601 @@ -1,3 +1,13 @@ +2006-06-13 Tim-Philipp Müller <tim at centricular dot net> + + * gst/gstregistryxml.c: (gst_registry_xml_write_cache): + Fix silly bug that prevented us from creating + ~/.gstreamer-0.10 and writing the registry in one + go (the first call to g_mkstemp() would overwrite the + placeholder in the template string, so the second call + to g_mkstemp() after creating the missing directory + would then error out with 'invalid argument'). 2006-06-13 Edward Hervey <ed...@fl...> * gst/gst.c: (init_post): Index: gstregistryxml.c RCS file: /cvs/gstreamer/gstreamer/gst/gstregistryxml.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- gstregistryxml.c 12 Jun 2006 09:17:44 -0000 1.26 +++ gstregistryxml.c 13 Jun 2006 13:30:46 -0000 1.27 @@ -840,11 +840,16 @@ g_mkdir_with_parents (dir, 0777); g_free (dir); - registry->cache_file = g_mkstemp (tmp_location); - } - if (registry->cache_file == -1) { + /* the previous g_mkstemp call overwrote the XXXXXX placeholder ... */ g_free (tmp_location); - return FALSE; + tmp_location = g_strconcat (location, ".tmpXXXXXX", NULL); + registry->cache_file = g_mkstemp (tmp_location); + if (registry->cache_file == -1) { + GST_DEBUG ("g_mkstemp() failed: %s", g_strerror (errno)); + g_free (tmp_location); + return FALSE; + } } if (!gst_registry_save (registry, "<?xml version=\"1.0\"?>\n")) |