Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
732fcc10
Commit
732fcc10
authored
May 30, 2018
by
Uwe Schulzweida
Browse files
Added error code CDI_ETMOF (Too many open files)
parent
a5ff9ed6
Changes
6
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
732fcc10
...
...
@@ -5,6 +5,7 @@
2018-05-30 Uwe Schulzweida
* Added error code CDI_ETMOF (Too many open files)
* file.c set default of MAX_FILES to 8192
2018-05-23 Uwe Schulzweida
...
...
src/cdf_util.c
View file @
732fcc10
...
...
@@ -201,6 +201,7 @@ bool is_lon_axis(const char *units, const char *stdname)
{
int
ioff
=
6
;
if
(
lc_units
[
ioff
]
==
's'
)
ioff
++
;
if
(
lc_units
[
ioff
]
==
' '
)
ioff
++
;
if
(
lc_units
[
ioff
]
==
'_'
)
ioff
++
;
if
(
lc_units
[
ioff
]
==
'e'
)
status
=
true
;
}
...
...
@@ -229,6 +230,7 @@ bool is_lat_axis(const char *units, const char *stdname)
{
int
ioff
=
6
;
if
(
lc_units
[
ioff
]
==
's'
)
ioff
++
;
if
(
lc_units
[
ioff
]
==
' '
)
ioff
++
;
if
(
lc_units
[
ioff
]
==
'_'
)
ioff
++
;
if
(
lc_units
[
ioff
]
==
'n'
||
lc_units
[
ioff
]
==
's'
)
status
=
true
;
}
...
...
src/cdi.h
View file @
732fcc10
...
...
@@ -35,6 +35,7 @@ extern "C" {
#define CDI_NOERR 0 // No Error
#define CDI_EEOF -1 // The end of file was encountered
#define CDI_ETMOF -9 // Too many open files
#define CDI_ESYSTEM -10 // Operating system error
#define CDI_EINVAL -20 // Invalid argument
#define CDI_EISDIR -21 // Is a directory
...
...
src/cdi_error.c
View file @
732fcc10
...
...
@@ -10,6 +10,7 @@
const
char
*
cdiStringError
(
int
cdiErrno
)
{
static
const
char
UnknownError
[]
=
"Unknown Error"
;
static
const
char
_ETMOF
[]
=
"Too many open files"
;
static
const
char
_EISDIR
[]
=
"Is a directory"
;
static
const
char
_EISEMPTY
[]
=
"File is empty"
;
static
const
char
_EUFTYPE
[]
=
"Unsupported file type"
;
...
...
@@ -26,6 +27,7 @@ const char *cdiStringError(int cdiErrno)
if
(
cp
==
NULL
)
break
;
return
cp
;
}
case
CDI_ETMOF
:
return
_ETMOF
;
case
CDI_EISDIR
:
return
_EISDIR
;
case
CDI_EISEMPTY
:
return
_EISEMPTY
;
case
CDI_EUFTYPE
:
return
_EUFTYPE
;
...
...
src/file.c
View file @
732fcc10
...
...
@@ -255,7 +255,10 @@ int file_from_pointer(bfile_t *ptr)
Message
(
"Pointer %p has idx %d from file list"
,
ptr
,
idx
);
}
else
Warning
(
"Too many open files (limit is %d)!"
,
_file_max
);
{
Warning
(
"Too many open files (limit is %d)!"
,
_file_max
);
idx
=
-
2
;
}
FILE_UNLOCK
();
}
...
...
src/stream.c
View file @
732fcc10
...
...
@@ -89,6 +89,7 @@ int cdiGetFiletype(const char *filename, int *byteorder)
else
return
CDI_ESYSTEM
;
}
else
if
(
fileID
==
-
2
)
return
CDI_ETMOF
;
char
buffer
[
8
];
if
(
fileRead
(
fileID
,
buffer
,
8
)
!=
8
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment