mirror of
https://github.com/fadden/nulib2.git
synced 2024-11-18 23:05:04 +00:00
Show the right error message when open/fdopen fails to open a temp
file because it already exists.
This commit is contained in:
parent
edc69e56ca
commit
e08ee80f12
@ -834,6 +834,10 @@ Nu_OpenTempFile(char* fileName, FILE** pFp)
|
||||
int fd;
|
||||
|
||||
fd = open(fileName, O_RDWR|O_CREAT|O_EXCL|O_BINARY, 0600);
|
||||
if (fd < 0) {
|
||||
err = errno ? errno : kNuErrFileOpen;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
*pFp = fdopen(fd, kNuFileOpenReadWriteCreat);
|
||||
if (*pFp == nil) {
|
||||
|
Loading…
Reference in New Issue
Block a user