[PATCH liburing 2/2] test/accept-link: Add `srand()` for better randomness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The use of `rand()` should be accompanied by `srand()`.

Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxx>
---
 test/accept-link.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/accept-link.c b/test/accept-link.c
index f111275..843f345 100644
--- a/test/accept-link.c
+++ b/test/accept-link.c
@@ -240,6 +240,9 @@ int main(int argc, char *argv[])
 {
 	if (argc > 1)
 		return 0;
+
+	srand((unsigned)time(NULL));
+
 	if (test_accept_timeout(0, 200000000)) {
 		fprintf(stderr, "accept timeout 0 failed\n");
 		return 1;
-- 
2.30.2




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux