diff options
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | src/pj_open_lib.c | 6 |
2 files changed, 7 insertions, 3 deletions
@@ -1,3 +1,7 @@ +2011-12-14 Frank Warmerdam <warmerdam@google.com> + + * src/pj_open_lib.c: make sure we check errno before logging messages (#131). + 2011-12-13 Frank Warmerdam <warmerdam@google.com> * src/PJ_healpix.c, etc: added healpix support contributed by 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; |
