[segyio] 263/376: Return early on successive calls to segy_mmap
Jørgen Kvalsvik
jokva-guest at moszumanska.debian.org
Wed Sep 20 08:04:42 UTC 2017
This is an automated email from the git hooks/post-receive script.
jokva-guest pushed a commit to branch debian
in repository segyio.
commit 7e31935e31652fc28d382af03f78fb82e2684dec
Author: Jørgen Kvalsvik <jokva at statoil.com>
Date: Wed Mar 29 13:43:37 2017 +0200
Return early on successive calls to segy_mmap
---
lib/src/segy.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/src/segy.c b/lib/src/segy.c
index 4d482c3..07d693f 100644
--- a/lib/src/segy.c
+++ b/lib/src/segy.c
@@ -353,6 +353,9 @@ int segy_mmap( segy_file* fp ) {
return SEGY_MMAP_INVALID;
#else
+ /* don't re-map; i.e. multiple consecutive calls should be no-ops */
+ if( fp->addr ) return SEGY_OK;
+
long long fsize;
int err = file_size( fp->fp, &fsize );
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/segyio.git
More information about the debian-science-commits
mailing list