mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:26:14 +00:00
gst/gstregistryxml.c: Fix silly bug that prevented us from creating ~/.gstreamer-0.10 and writing the registry in one...
Original commit message from CVS: * 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').
This commit is contained in:
parent
0b680571ab
commit
d50e3a7951
2 changed files with 19 additions and 4 deletions
10
ChangeLog
10
ChangeLog
|
@ -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 <edward@fluendo.com>
|
2006-06-13 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
* gst/gst.c: (init_post):
|
* gst/gst.c: (init_post):
|
||||||
|
|
|
@ -840,11 +840,16 @@ gst_registry_xml_write_cache (GstRegistry * registry, const char *location)
|
||||||
g_mkdir_with_parents (dir, 0777);
|
g_mkdir_with_parents (dir, 0777);
|
||||||
g_free (dir);
|
g_free (dir);
|
||||||
|
|
||||||
registry->cache_file = g_mkstemp (tmp_location);
|
/* the previous g_mkstemp call overwrote the XXXXXX placeholder ... */
|
||||||
}
|
|
||||||
if (registry->cache_file == -1) {
|
|
||||||
g_free (tmp_location);
|
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"))
|
if (!gst_registry_save (registry, "<?xml version=\"1.0\"?>\n"))
|
||||||
|
|
Loading…
Reference in a new issue