aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2011-12-15 01:20:23 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2011-12-15 01:20:23 +0000
commit33f73be49591d5de9b21905941b4705a37e2e4a9 (patch)
treec4119aaede27274e22c74ccf0ed68126f0398c7b /src
parentdf31356ed82185ab6fd207a98ef39aaaed6c20ea (diff)
downloadPROJ-33f73be49591d5de9b21905941b4705a37e2e4a9.tar.gz
PROJ-33f73be49591d5de9b21905941b4705a37e2e4a9.zip
ensure we check errno before logging messages (#131)
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2130 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src')
-rw-r--r--src/pj_open_lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pj_open_lib.c b/src/pj_open_lib.c
index 22c180a8..bc8c98ac 100644
--- a/src/pj_open_lib.c
+++ b/src/pj_open_lib.c
@@ -161,14 +161,14 @@ pj_open_lib(projCtx ctx, char *name, char *mode) {
errno = 0;
}
+ if( ctx->last_errno == 0 && errno != 0 )
+ pj_ctx_set_errno( ctx, errno );
+
pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
"pj_open_lib(%s): call fopen(%s) - %s\n",
name, sysname,
fid == NULL ? "failed" : "succeeded" );
- if( ctx->last_errno == 0 && errno != 0 )
- pj_ctx_set_errno( ctx, errno );
-
return(fid);
#else
return NULL;