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

[dm-devel] [PATCH] multipath-tools: fix a porting bug for random libprio



Hi Christophe,

The random prioritizer were not converted to the new scheme.
It should return the priority instead of print it.

--- git-20071214/libprio/random.c	2007-12-14 15:48:28.000000000 -0500
+++ random-prio-fix/libprio/random.c	2007-12-19 18:05:50.000000000 -0500
@@ -7,10 +7,11 @@
 
 int prio_random(struct path * pp)
 {
+	int ret;
 	struct timeval tv;
 	
 	gettimeofday(&tv, NULL);
 	srand((unsigned int)tv.tv_usec);
-	printf("%i\n", 1+(int) (10.0*rand()/(RAND_MAX+1.0)));
-	return 0;
+	ret = 1 + (int)(10.0 * rand() / (RAND_MAX + 1.0));
+	return ret;
 }

Thanks,
Kiyoshi Ueda


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