ObjFW  Check-in [516936e0c0]

Overview
Comment:OFFileManager: Set errno to 0 before readdir()

glibc documents this as being required, as does POSIX. However, none of
the BSDs document this, and don't seem to require it.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 516936e0c069e62e788f195fee0b79eefbaeeb4db28336dca65579a32b03ac1b
User & Date: js on 2017-08-03 19:18:32
Other Links: manifest | tags
Context
2017-08-05
10:04
OFDate: Add -[localMinute] check-in: da9b9d7e3b user: js tags: trunk
2017-08-03
19:18
OFFileManager: Set errno to 0 before readdir() check-in: 516936e0c0 user: js tags: trunk
2017-08-02
20:23
OFFile: Remove the b modes from MorphOS check-in: 18d04d2fd4 user: js tags: trunk
Changes

Modified src/OFFileManager.m from [7bb3d63d81] to [f7096a9a7b].

569
570
571
572
573
574
575

576
577
578
579
580
581
582
				    exceptionWithObject: self
					requestedLength: 0
						  errNo: errno];

			if (dirent == NULL)
				break;
# else

			if ((dirent = readdir(dir)) == NULL) {
				if (errno == 0)
					break;
				else
					@throw [OFReadFailedException
					    exceptionWithObject: self
						requestedLength: 0







>







569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
				    exceptionWithObject: self
					requestedLength: 0
						  errNo: errno];

			if (dirent == NULL)
				break;
# else
			errno = 0;
			if ((dirent = readdir(dir)) == NULL) {
				if (errno == 0)
					break;
				else
					@throw [OFReadFailedException
					    exceptionWithObject: self
						requestedLength: 0