2007-04-30 Marcus Brinkmann <marcus@g10code.de>

* engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
	* rungpg.c (gpg_new): Likewise.
	Submitted by Stephen Tether.
This commit is contained in:
Marcus Brinkmann 2007-04-30 18:37:22 +00:00
parent c8a3156192
commit 0bd4e4c4d1
3 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2007-04-30 Marcus Brinkmann <marcus@g10code.de>
* 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 <wk@g10code.com> 2007-02-26 Werner Koch <wk@g10code.com>
* verify.c (op_data_t): New element PLAINTEXT_SEEN. * verify.c (op_data_t): New element PLAINTEXT_SEEN.

View File

@ -448,9 +448,12 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir)
if (isatty (1)) 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; goto leave;
} }
else else

View File

@ -476,7 +476,10 @@ gpg_new (void **engine, const char *file_name, const char *home_dir)
if (isatty (1)) 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); rc = gpg_error_from_errno (errno);
else else
{ {