diff options
author | Werner Koch <[email protected]> | 2013-02-06 16:35:40 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2013-02-06 16:35:40 +0000 |
commit | 51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c (patch) | |
tree | d431a193f5eece63dba5aa6485416e79f67396cb /src/wait-global.c | |
parent | Improve parsing of the GIT revision number. (diff) | |
download | gpgme-51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c.tar.gz gpgme-51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c.zip |
Use gpg_error_from_syserror instead of directly accessing errno.
--
Also fixed a couple of minor thing; e.g. save the error before calling
cleanup functions. Do not save the errno if only free is called
in between.
Diffstat (limited to 'src/wait-global.c')
-rw-r--r-- | src/wait-global.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wait-global.c b/src/wait-global.c index 9a194b0d..f03775e2 100644 --- a/src/wait-global.c +++ b/src/wait-global.c @@ -97,7 +97,7 @@ ctx_active (gpgme_ctx_t ctx) { struct ctx_list_item *li = malloc (sizeof (struct ctx_list_item)); if (!li) - return gpg_error_from_errno (errno); + return gpg_error_from_syserror (); li->ctx = ctx; LOCK (ctx_list_lock); @@ -269,10 +269,10 @@ gpgme_wait_ext (gpgme_ctx_t ctx, gpgme_error_t *status, fdt.fds = malloc (i * sizeof (struct io_select_fd_s)); if (!fdt.fds) { - int saved_errno = errno; + int saved_err = gpg_error_from_syserror (); UNLOCK (ctx_list_lock); if (status) - *status = gpg_error_from_errno (saved_errno); + *status = saved_err; if (op_err) *op_err = 0; return NULL; @@ -290,10 +290,10 @@ gpgme_wait_ext (gpgme_ctx_t ctx, gpgme_error_t *status, nr = _gpgme_io_select (fdt.fds, fdt.size, 0); if (nr < 0) { - int saved_errno = errno; + int saved_err = gpg_error_from_syserror (); free (fdt.fds); if (status) - *status = gpg_error_from_errno (saved_errno); + *status = saved_err; if (op_err) *op_err = 0; return NULL; |