Skip to content

Commit 2e83b97

Browse files
Only attempt to close RNG file descriptor on platforms with XCLOSE.
1 parent fb880e9 commit 2e83b97

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/src/random.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,9 +1377,9 @@ int wc_FreeRng(WC_RNG* rng)
13771377
ret = WC_HW_E;
13781378
#endif
13791379

1380-
#ifndef USE_WINDOWS_API
1380+
#ifdef XCLOSE
13811381
if(rng->seed.fd != 0 && rng->seed.fd != -1) {
1382-
close(rng->seed.fd);
1382+
XCLOSE(rng->seed.fd);
13831383
rng->seed.fd = -1;
13841384
}
13851385
#endif

0 commit comments

Comments
 (0)