#else
int fd = mkstemp(buf);
- switch (fd)
- {
- case EINVAL:
- gmx_fatal(FARGS, "Invalid template %s for mkstemp", buf);
- break;
- case EEXIST:
- gmx_fatal(FARGS, "mkstemp created existing file", buf);
- break;
- case EACCES:
- gmx_fatal(FARGS, "Permission denied for opening %s", buf);
- break;
- default:
- break;
+ if (fd < 0)
+ {
+ gmx_fatal(FARGS, "Creating temporary file %s: %s", buf,
+ strerror(errno));
}
close(fd);
#endif