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/engine-g13.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/engine-g13.c')
-rw-r--r-- | src/engine-g13.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/engine-g13.c b/src/engine-g13.c index 9850d6b4..9231a9ac 100644 --- a/src/engine-g13.c +++ b/src/engine-g13.c @@ -225,7 +225,7 @@ g13_new (void **engine, const char *file_name, const char *home_dir) g13 = calloc (1, sizeof *g13); if (!g13) - return gpg_error_from_errno (errno); + return gpg_error_from_syserror (); g13->status_cb.fd = -1; g13->status_cb.dir = 1; @@ -269,7 +269,7 @@ g13_new (void **engine, const char *file_name, const char *home_dir) if (asprintf (&optstr, "OPTION display=%s", dft_display) < 0) { free (dft_display); - err = gpg_error_from_errno (errno); + err = gpg_error_from_syserror (); goto leave; } free (dft_display); @@ -295,7 +295,7 @@ g13_new (void **engine, const char *file_name, const char *home_dir) { if (asprintf (&optstr, "OPTION ttyname=%s", dft_ttyname) < 0) { - err = gpg_error_from_errno (errno); + err = gpg_error_from_syserror (); goto leave; } err = assuan_transact (g13->assuan_ctx, optstr, NULL, NULL, NULL, @@ -312,7 +312,7 @@ g13_new (void **engine, const char *file_name, const char *home_dir) if (asprintf (&optstr, "OPTION ttytype=%s", dft_ttytype) < 0) { free (dft_ttytype); - err = gpg_error_from_errno (errno); + err = gpg_error_from_syserror (); goto leave; } free (dft_ttytype); @@ -390,7 +390,7 @@ g13_set_locale (void *engine, int category, const char *value) return 0; if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0) - err = gpg_error_from_errno (errno); + err = gpg_error_from_syserror (); else { err = assuan_transact (g13->assuan_ctx, optstr, NULL, NULL, |