Browse Source

Set errno to 0 before calling readdir in Syscall.readdir().

This will allow the caller to distinguish between errors and end-of-directory.
Steffen Kieß 12 năm trước cách đây
mục cha
commit
6ceccd8cd2
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      support/dirent.c

+ 1 - 0
support/dirent.c

@@ -78,6 +78,7 @@ Mono_Posix_Syscall_readdir (void *dirp, struct Mono_Posix_Syscall__Dirent *entry
 		return -1;
 	}
 
+	errno = 0;
 	d = readdir (dirp);
 
 	if (d == NULL) {