diff options
author | Werner Koch <[email protected]> | 2019-06-06 16:59:16 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-06-06 16:59:16 +0000 |
commit | f6fd90c99aea8b604d76ae49d29bc5269c236a98 (patch) | |
tree | 3b27962ae27f4df002f8504d1736d138e3053571 | |
parent | core: Add commented debug helper to posix-io.c. (diff) | |
download | gpgme-f6fd90c99aea8b604d76ae49d29bc5269c236a98.tar.gz gpgme-f6fd90c99aea8b604d76ae49d29bc5269c236a98.zip |
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 <[email protected]>
-rw-r--r-- | tests/run-threaded.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/run-threaded.c b/tests/run-threaded.c index 0e46bd2d..1fe4f192 100644 --- a/tests/run-threaded.c +++ b/tests/run-threaded.c @@ -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); } |