diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2019-04-02 13:30:33 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2019-04-02 20:58:35 +0200 |
| commit | 20300c1fd5b35bf1d577a3726f02940d02c73f54 (patch) | |
| tree | 0706b4f3102bf1ba1f459b50d0ea0ad875d84c24 /src/iso19111/c_api.cpp | |
| parent | 2a0ad3d42c7342ee060791aba01f70f058238dce (diff) | |
| download | PROJ-20300c1fd5b35bf1d577a3726f02940d02c73f54.tar.gz PROJ-20300c1fd5b35bf1d577a3726f02940d02c73f54.zip | |
Make sure that ISO19111 C++ code sets pj_errno on errors
Diffstat (limited to 'src/iso19111/c_api.cpp')
| -rw-r--r-- | src/iso19111/c_api.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp index b15b8e34..970d38d8 100644 --- a/src/iso19111/c_api.cpp +++ b/src/iso19111/c_api.cpp @@ -77,6 +77,11 @@ static void PROJ_NO_INLINE proj_log_error(PJ_CONTEXT *ctx, const char *function, msg += ": "; msg += text; ctx->logger(ctx->logger_app_data, PJ_LOG_ERROR, msg.c_str()); + auto previous_errno = pj_ctx_get_errno(ctx); + if (previous_errno == 0) { + // only set errno if it wasn't set deeper down the call stack + pj_ctx_set_errno(ctx, PJD_ERR_GENERIC_ERROR); + } } // --------------------------------------------------------------------------- |
