From: Marcus Brinkmann Date: Mon, 30 Apr 2007 18:37:22 +0000 (+0000) Subject: 2007-04-30 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~170 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=64e94518b196f2efc2d859fcc2709330ea26f1d4;p=gpgme.git 2007-04-30 Marcus Brinkmann * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r. * rungpg.c (gpg_new): Likewise. Submitted by Stephen Tether. --- diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 5c31489..b690087 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,9 @@ +2007-04-30 Marcus Brinkmann + + * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r. + * rungpg.c (gpg_new): Likewise. + Submitted by Stephen Tether. + 2007-02-26 Werner Koch * verify.c (op_data_t): New element PLAINTEXT_SEEN. diff --git a/trunk/gpgme/engine-gpgsm.c b/trunk/gpgme/engine-gpgsm.c index 7bb71cf..02f506c 100644 --- a/trunk/gpgme/engine-gpgsm.c +++ b/trunk/gpgme/engine-gpgsm.c @@ -448,9 +448,12 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir) if (isatty (1)) { - if (ttyname_r (1, dft_ttyname, sizeof (dft_ttyname))) + int rc; + + rc = ttyname_r (1, dft_ttyname, sizeof (dft_ttyname)); + if (rc) { - err = gpg_error_from_errno (errno); + err = gpg_error_from_errno (rc); goto leave; } else diff --git a/trunk/gpgme/rungpg.c b/trunk/gpgme/rungpg.c index 58ab39d..d6fd8fe 100644 --- a/trunk/gpgme/rungpg.c +++ b/trunk/gpgme/rungpg.c @@ -476,7 +476,10 @@ gpg_new (void **engine, const char *file_name, const char *home_dir) if (isatty (1)) { - if (ttyname_r (1, dft_ttyname, sizeof (dft_ttyname))) + int err; + + err = ttyname_r (1, dft_ttyname, sizeof (dft_ttyname)); + if (err) rc = gpg_error_from_errno (errno); else {