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:
parent
f84abcad25
commit
f6fd90c99a
@ -284,6 +284,9 @@ random_data_new (const char *fname)
|
||||
{
|
||||
data_t ret = calloc (1, sizeof (struct data_s));
|
||||
int data_rand;
|
||||
|
||||
ret->fd = -1;
|
||||
|
||||
if (data_type)
|
||||
{
|
||||
data_rand = data_type;
|
||||
@ -357,7 +360,8 @@ random_data_close (data_t data)
|
||||
{
|
||||
gpgme_data_release (data->dh);
|
||||
}
|
||||
if (data->fd)
|
||||
|
||||
if (data->fd != -1)
|
||||
{
|
||||
close (data->fd);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user