Merge pull request #2610 from WardF/pnetcdf-fd-fix.wif

Incorporate fix for errno check when fd < 0
This commit is contained in:
Ward Fisher 2023-02-06 19:34:43 -07:00 committed by GitHub
commit b1fd4b840d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1768,7 +1768,7 @@ posixio_open(const char *path,
#endif
if(fd < 0)
{
status = errno;
status = errno ? errno : ENOENT;
goto unwind_new;
}
*((int *)&nciop->fd) = fd; /* cast away const */