Sensible names for temporary ROMs in Hydra

This commit is contained in:
Martin Griffin 2023-06-22 17:16:52 +01:00
parent 20aea1f32f
commit e8b2eea89d

View File

@ -296,7 +296,7 @@ int main(int argc, char *argv[])
_exit(2); _exit(2);
} }
char rom_path[FILENAME_MAX]; char rom_path[FILENAME_MAX];
sprintf(rom_path, "/tmp/file%05d", getpid()); sprintf(rom_path, "/tmp/mgba-rom-test-hydra-%05d", getpid());
int tmpfd; int tmpfd;
if ((tmpfd = open(rom_path, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) == -1) if ((tmpfd = open(rom_path, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) == -1)
{ {
@ -378,7 +378,7 @@ int main(int argc, char *argv[])
} }
} else { } else {
runners[i].pid = pid; runners[i].pid = pid;
sprintf(runners[i].rom_path, "/tmp/file%05d", runners[i].pid); sprintf(runners[i].rom_path, "/tmp/mgba-rom-test-hydra-%05d", runners[i].pid);
runners[i].outfd = pipefds[0]; runners[i].outfd = pipefds[0];
if (close(pipefds[1]) == -1) if (close(pipefds[1]) == -1)
{ {