tests: Minor fix to run-threaded.c.

* tests/run-threaded.c (random_data_close): Correct FD test.
--

An invalid DS is -1 and not 0; this fix is for correctness and does
not chnage anything in the real world.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-06-06 18:59:16 +02:00
parent f84abcad25
commit f6fd90c99a
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -284,6 +284,9 @@ random_data_new (const char *fname)
{ {
data_t ret = calloc (1, sizeof (struct data_s)); data_t ret = calloc (1, sizeof (struct data_s));
int data_rand; int data_rand;
ret->fd = -1;
if (data_type) if (data_type)
{ {
data_rand = data_type; data_rand = data_type;
@ -357,7 +360,8 @@ random_data_close (data_t data)
{ {
gpgme_data_release (data->dh); gpgme_data_release (data->dh);
} }
if (data->fd)
if (data->fd != -1)
{ {
close (data->fd); close (data->fd);
} }