@@ -404,8 +404,8 @@ create_update_dir (char *override_dir)
404404static int
405405file_exists (const char * file )
406406{
407- struct stat s ;
408- if (stat (file , & s ) == 0 && (s .st_mode & S_IFMT ) == S_IFREG )
407+ monodroid_stat_t s ;
408+ if (monodroid_stat (file , & s ) == 0 && (s .st_mode & S_IFMT ) == S_IFREG )
409409 return 1 ;
410410 return 0 ;
411411}
@@ -419,17 +419,17 @@ file_executable (const char *file)
419419 const int s_ixugo = S_IXUSR ;
420420#endif
421421
422- struct stat s ;
423- if (stat (file , & s ) == 0 && (s .st_mode & S_IFMT ) == S_IFREG && (s .st_mode & s_ixugo ) != 0 )
422+ monodroid_stat_t s ;
423+ if (monodroid_stat (file , & s ) == 0 && (s .st_mode & S_IFMT ) == S_IFREG && (s .st_mode & s_ixugo ) != 0 )
424424 return 1 ;
425425 return 0 ;
426426}
427427
428428static int
429429directory_exists (const char * directory )
430430{
431- struct stat s ;
432- if (stat (directory , & s ) == 0 && (s .st_mode & S_IFMT ) == S_IFDIR )
431+ monodroid_stat_t s ;
432+ if (monodroid_stat (directory , & s ) == 0 && (s .st_mode & S_IFMT ) == S_IFDIR )
433433 return 1 ;
434434 return 0 ;
435435}
@@ -521,13 +521,13 @@ setenv(const char *name, const char *value, int overwrite)
521521static pthread_mutex_t readdir_mutex = PTHREAD_MUTEX_INITIALIZER ;
522522
523523static int
524- readdir_r (DIR * dirp , struct dirent * entry , struct dirent * * result )
524+ readdir_r (_WDIR * dirp , struct _wdirent * entry , struct _wdirent * * result )
525525{
526526 int error_code = 0 ;
527527
528528 pthread_mutex_lock (& readdir_mutex );
529529 errno = 0 ;
530- entry = readdir (dirp );
530+ entry = _wreaddir (dirp );
531531 * result = entry ;
532532
533533 if (entry == NULL && errno != 0 )
@@ -1743,21 +1743,22 @@ count_override_assemblies (void)
17431743 int i ;
17441744
17451745 for (i = 0 ; i < MAX_OVERRIDES ; ++ i ) {
1746- DIR * dir ;
1747- struct dirent b , * e ;
1746+ monodroid_dir_t * dir ;
1747+ monodroid_dirent_t b , * e ;
17481748
17491749 const char * dir_path = override_dirs [i ];
1750+
17501751 if (dir_path == NULL || !directory_exists (dir_path ))
17511752 continue ;
17521753
1753- if ((dir = opendir (dir_path )) == NULL )
1754+ if ((dir = monodroid_opendir (dir_path )) == NULL )
17541755 continue ;
17551756
17561757 while (readdir_r (dir , & b , & e ) == 0 && e ) {
1757- if (ends_with (e -> d_name , ".dll" ))
1758+ if (monodroid_dirent_hasextension (e , ".dll" ))
17581759 ++ c ;
17591760 }
1760- closedir (dir );
1761+ monodroid_closedir (dir );
17611762 }
17621763
17631764 return c ;
0 commit comments