~ubuntu-branches/ubuntu/quantal/lvm2/quantal

« back to all changes in this revision

Viewing changes to lib/device/dev-cache.c

  • Committer: Steve Langasek
  • Date: 2012-04-14 02:57:53 UTC
  • mfrom: (3.1.22 sid)
  • Revision ID: steve.langasek@canonical.com-20120414025753-ejbdw9c8llik58y9
Merge version 2.02.88-2 from Debian testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
        if ((r = _apply_builtin_path_preference_rules(path0, path1)) >= 0)
250
250
                return r;
251
251
 
 
252
        /* Put /dev/block/ names last regardless of path shortness.
 
253
         * FIXME It would be better if we could do this in the configuration
 
254
         * file, but the only way to do so with preferred_names is to try to
 
255
         * enumerate all the possible names we might want to prefer over
 
256
         * /dev/block/. */
 
257
        m0 = strncmp(path0, "/dev/block/", 11);
 
258
        m1 = strncmp(path1, "/dev/block/", 11);
 
259
 
 
260
        if (m0 != m1) {
 
261
                if (m0 == 0)
 
262
                        return 1;
 
263
                if (m1 == 0)
 
264
                        return 0;
 
265
        }
 
266
 
252
267
        /* Return the path with fewer slashes */
253
268
        for (p = path0; p++; p = (const char *) strchr(p, '/'))
254
269
                slash0++;