mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +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>
|
||||
|
||||
* 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_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"))
|
||||
|
|
Loading…
Reference in a new issue