Commit 00606aa9 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

fileOpen: check errno

parent c6c88649
...@@ -15,8 +15,6 @@ char *cdiStringError(int cdiErrno) ...@@ -15,8 +15,6 @@ char *cdiStringError(int cdiErrno)
static char _EUNC4[] = "Unsupported netCDF4 structure"; static char _EUNC4[] = "Unsupported netCDF4 structure";
static char _ELIMIT[] = "Internal limits exceeded"; static char _ELIMIT[] = "Internal limits exceeded";
printf("cdiErrno: %d\n", cdiErrno);
printf("errno: %d\n", errno);
switch (cdiErrno) { switch (cdiErrno) {
case CDI_ESYSTEM: case CDI_ESYSTEM:
{ {
......
...@@ -615,6 +615,7 @@ int streamOpen(const char *filename, const char *filemode, int filetype) ...@@ -615,6 +615,7 @@ int streamOpen(const char *filename, const char *filemode, int filetype)
case FILETYPE_SRV: case FILETYPE_SRV:
{ {
fileID = fileOpen(filename, filemode); fileID = fileOpen(filename, filemode);
if ( fileID < 0 ) fileID = CDI_ESYSTEM;
record = (Record *) malloc(sizeof(Record)); record = (Record *) malloc(sizeof(Record));
record->buffer = NULL; record->buffer = NULL;
record->srvp = srvNew(); record->srvp = srvNew();
...@@ -625,6 +626,7 @@ int streamOpen(const char *filename, const char *filemode, int filetype) ...@@ -625,6 +626,7 @@ int streamOpen(const char *filename, const char *filemode, int filetype)
case FILETYPE_EXT: case FILETYPE_EXT:
{ {
fileID = fileOpen(filename, filemode); fileID = fileOpen(filename, filemode);
if ( fileID < 0 ) fileID = CDI_ESYSTEM;
record = (Record *) malloc(sizeof(Record)); record = (Record *) malloc(sizeof(Record));
record->buffer = NULL; record->buffer = NULL;
record->extp = extNew(); record->extp = extNew();
...@@ -635,6 +637,7 @@ int streamOpen(const char *filename, const char *filemode, int filetype) ...@@ -635,6 +637,7 @@ int streamOpen(const char *filename, const char *filemode, int filetype)
case FILETYPE_IEG: case FILETYPE_IEG:
{ {
fileID = fileOpen(filename, filemode); fileID = fileOpen(filename, filemode);
if ( fileID < 0 ) fileID = CDI_ESYSTEM;
record = (Record *) malloc(sizeof(Record)); record = (Record *) malloc(sizeof(Record));
record->buffer = NULL; record->buffer = NULL;
record->iegp = iegNew(); record->iegp = iegNew();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment