2004-03-08  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136080.

	* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
	ENOENT.
	(filename_get_info): Likewise.
This commit is contained in:
Federico Mena Quintero 2004-03-09 00:34:17 +00:00 committed by Federico Mena Quintero
parent 993c96ed62
commit 57cbeff08e
6 changed files with 68 additions and 25 deletions

View File

@ -1,3 +1,11 @@
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c

View File

@ -1,3 +1,11 @@
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c

View File

@ -1,3 +1,11 @@
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c

View File

@ -1,3 +1,11 @@
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c

View File

@ -1,3 +1,11 @@
2004-03-08 Federico Mena Quintero <federico@ximian.com>
Fixes #136080.
* gtk/gtkfilesystemunix.c: Only lstat() if stat() failed due to
ENOENT.
(filename_get_info): Likewise.
2004-03-08 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdefault.c

View File

@ -464,8 +464,9 @@ get_icon_type (const char *filename,
/* If stat fails, try to fall back to lstat to catch broken links
*/
if (stat (filename, &statbuf) != 0 &&
lstat (filename, &statbuf) != 0)
if (stat (filename, &statbuf) != 0)
{
if (errno != ENOENT || lstat (filename, &statbuf) != 0)
{
int save_errno = errno;
gchar *filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
@ -479,6 +480,7 @@ get_icon_type (const char *filename,
return ICON_NONE;
}
}
if (S_ISBLK (statbuf.st_mode))
icon_type = ICON_BLOCK_DEVICE;
@ -1387,9 +1389,9 @@ filename_get_info (const gchar *filename,
/* If stat fails, try to fall back to lstat to catch broken links
*/
if (do_stat &&
stat (filename, &statbuf) != 0 &&
lstat (filename, &statbuf) != 0)
if (do_stat && stat (filename, &statbuf) != 0)
{
if (errno != ENOENT || lstat (filename, &statbuf) != 0)
{
int save_errno = errno;
gchar *filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
@ -1403,6 +1405,7 @@ filename_get_info (const gchar *filename,
return NULL;
}
}
info = gtk_file_info_new ();