Set FD_CLOEXEC on underlying CHD file descriptors (#646)

Co-authored-by: Zakk <zakk@rsdio.com>
This commit is contained in:
zakk4223
2022-06-20 12:08:31 -04:00
committed by GitHub
parent 35b4e8f6fa
commit 6d65491ae4

View File

@@ -46,8 +46,12 @@ chd_error mister_load_chd(const char *filename, toc_t *cd_toc)
}
mister_chd_log("hunkbytes %d unitbytes %d logical length %llu\n", chd_header->hunkbytes, chd_header->unitbytes, chd_header->logicalbytes);
//Load track info
//Set CLOEXEC on underlying FD
int chd_fd = fileno(chd_core_file(cd_toc->chd_f));
if (chd_fd) fcntl(chd_fd, F_SETFD, FD_CLOEXEC);
//Load track info
int sector_cnt = 0;
for (cd_toc->last = 0; cd_toc->last < 99; cd_toc->last++)
{