On Linux: avoid blocking in DOSFS_OpenDir_VFAT if specified path is

not a directory.
This commit is contained in:
Michal Janusz Miroslaw 2003-04-19 02:47:08 +00:00 committed by Alexandre Julliard
parent 9aee7c605d
commit 9786b058df
1 changed files with 6 additions and 1 deletions

View File

@ -75,6 +75,11 @@ typedef struct
#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, KERNEL_DIRENT [2] ) #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, KERNEL_DIRENT [2] )
/* To avoid blocking on non-directories in DOSFS_OpenDir_VFAT*/
#ifndef O_DIRECTORY
# define O_DIRECTORY 0200000 /* must be directory */
#endif
#else /* linux */ #else /* linux */
#undef VFAT_IOCTL_READDIR_BOTH /* just in case... */ #undef VFAT_IOCTL_READDIR_BOTH /* just in case... */
#endif /* linux */ #endif /* linux */
@ -461,7 +466,7 @@ static BOOL DOSFS_OpenDir_VFAT(UINT codepage, DOS_DIR **dir, const char *unix_pa
{ {
#ifdef VFAT_IOCTL_READDIR_BOTH #ifdef VFAT_IOCTL_READDIR_BOTH
KERNEL_DIRENT de[2]; KERNEL_DIRENT de[2];
int fd = open( unix_path, O_RDONLY ); int fd = open( unix_path, O_RDONLY|O_DIRECTORY );
BOOL r = TRUE; BOOL r = TRUE;
/* Check if the VFAT ioctl is supported on this directory */ /* Check if the VFAT ioctl is supported on this directory */