gst/registries/gstxmlregistry.c: don't rely on g_dir_open to figure out if a file is a directory, use explicit G_TEST...

Original commit message from CVS:
reviewed by Benjamin Otte  <otte@gnome.org>
* gst/registries/gstxmlregistry.c:
(gst_xml_registry_rebuild_recurse):
don't rely on g_dir_open to figure out if a file is a directory, use
explicit G_TEST_IS_DIR. Reiserfs4 allows opening files as
directories. (fixes #142850)
This commit is contained in:
Benjamin Otte 2004-06-06 20:40:29 +00:00
parent 502660a784
commit 60de88e46c
2 changed files with 27 additions and 16 deletions

View file

@ -1,3 +1,13 @@
2004-06-06 ed@catmur.co.uk
reviewed by Benjamin Otte <otte@gnome.org>
* gst/registries/gstxmlregistry.c:
(gst_xml_registry_rebuild_recurse):
don't rely on g_dir_open to figure out if a file is a directory, use
explicit G_TEST_IS_DIR. Reiserfs4 allows opening files as
directories. (fixes #142850)
2004-06-06 Benjamin Otte <otte@gnome.org> 2004-06-06 Benjamin Otte <otte@gnome.org>
* gst/gstqueue.c: (gst_queue_dispose), (gst_queue_change_state): * gst/gstqueue.c: (gst_queue_dispose), (gst_queue_change_state):

View file

@ -1331,11 +1331,11 @@ static GList *
gst_xml_registry_rebuild_recurse (GstXMLRegistry * registry, gst_xml_registry_rebuild_recurse (GstXMLRegistry * registry,
const gchar * directory) const gchar * directory)
{ {
GDir *dir;
GList *ret = NULL; GList *ret = NULL;
gint dr_len, sf_len; gint dr_len, sf_len;
dir = g_dir_open (directory, 0, NULL); if (g_file_test (directory, G_FILE_TEST_IS_DIR)) {
GDir *dir = g_dir_open (directory, 0, NULL);
if (dir) { if (dir) {
const gchar *dirent; const gchar *dirent;
@ -1355,6 +1355,7 @@ gst_xml_registry_rebuild_recurse (GstXMLRegistry * registry,
g_free (dirname); g_free (dirname);
} }
g_dir_close (dir); g_dir_close (dir);
}
} else { } else {
dr_len = strlen (directory); dr_len = strlen (directory);
sf_len = strlen (G_MODULE_SUFFIX); sf_len = strlen (G_MODULE_SUFFIX);