~ubuntu-branches/debian/squeeze/multipath-tools/squeeze

« back to all changes in this revision

Viewing changes to libmultipath/prioritizers/random.c

  • Committer: Bazaar Package Importer
  • Author(s): Guido Günther
  • Date: 2010-04-11 13:22:35 UTC
  • mfrom: (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100411132235-p0xdu9sy65mlx32z
Tags: 0.4.8+git0.761c66f-8
* [16268d8] Drop path from dmsetup_env call - thanks to Ferenc Wagner
* [2f3bdd5] Use $name in multipath.udev as well - thanks to Ferenc Wagner
  for testing
* [c978487] Don't pass -g on mips(el) to work around a binutils bug.  See
  http://sources.redhat.com/bugzilla/show_bug.cgi?id=10144 for details.
* [9daf438] Make sure we discover multipaths before checkfs/mountall runs
  This covers the cornercase where e.g. /home is on multipath (but not on
  LVM) and multipath-tols aren't started via initramfs. (Closes: #577172)
* [f7cc840] Bump standards version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <stdlib.h>
 
3
#include <sys/time.h>
 
4
#include <time.h>
 
5
 
 
6
#include <prio.h>
 
7
 
 
8
int getprio (struct path * pp)
 
9
{
 
10
        struct timeval tv;
 
11
        
 
12
        gettimeofday(&tv, NULL);
 
13
        srand((unsigned int)tv.tv_usec);
 
14
        return 1+(int) (10.0*rand()/(RAND_MAX+1.0));
 
15
}