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

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

 



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

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux