28 May
2020
28 May
'20
10:16 p.m.
Let's see what POSIX has to say:
Upon calling closedir() the file descriptor shall be closed.[1]
Most modern systems should conform to POSIX. I think you should be OK removing the close(2) call.
[1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdopendir.html#
ah... i was looking at an older version of the docs. will do thanks daniel