Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
bc6a8ad2
Commit
bc6a8ad2
authored
May 31, 2018
by
Uwe Schulzweida
Browse files
Limit chunksizehint to filesize.
parent
732fcc10
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
bc6a8ad2
...
...
@@ -3,6 +3,10 @@
* using CGRIBEX library version 1.9.1
* Version 1.9.5 released
2018-05-31 Uwe Schulzweida
* Limit chunksizehint to filesize
2018-05-30 Uwe Schulzweida
* Added error code CDI_ETMOF (Too many open files)
...
...
src/cdf_int.c
View file @
bc6a8ad2
...
...
@@ -77,7 +77,7 @@ int cdf_open(const char *path, int omode, int *ncidp)
struct
stat
filestat
;
size_t
chunksizehint
=
0
;
#if
def
ined (
HAVE_LIBNC_DAP
)
#ifdef
HAVE_LIBNC_DAP
if
(
strncmp
(
path
,
"http:"
,
5
)
==
0
||
strncmp
(
path
,
"https:"
,
6
)
==
0
)
dapfile
=
true
;
#endif
...
...
@@ -89,8 +89,9 @@ int cdf_open(const char *path, int omode, int *ncidp)
{
if
(
stat
(
path
,
&
filestat
)
!=
0
)
SysError
(
path
);
#if
def
ined (
HAVE_STRUCT_STAT_ST_BLKSIZE
)
#ifdef
HAVE_STRUCT_STAT_ST_BLKSIZE
chunksizehint
=
(
size_t
)
filestat
.
st_blksize
*
4
;
if
(
chunksizehint
>
(
size_t
)
filestat
.
st_size
)
chunksizehint
=
(
size_t
)
filestat
.
st_size
;
#endif
/*
if ( chunksizehint < ChunkSizeMin ) chunksizehint = ChunkSizeMin;
...
...
@@ -101,7 +102,7 @@ int cdf_open(const char *path, int omode, int *ncidp)
/* FIXME: parallel part missing */
status
=
nc__open
(
path
,
omode
,
&
chunksizehint
,
ncidp
);
if
(
CDF_Debug
)
Message
(
"chunksizehint %
d
"
,
chunksizehint
);
if
(
CDF_Debug
)
Message
(
"chunksizehint %
zu
"
,
chunksizehint
);
}
if
(
CDF_Debug
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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