~xnox/ubuntu/quantal/lvm2/merge95

« back to all changes in this revision

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

  • Committer: Dmitrijs Ledkovs
  • Date: 2012-08-15 09:45:58 UTC
  • Revision ID: dmitrijs.ledkovs@canonical.com-20120815094558-1fugetlxzs49g6g9
quilt push

Show diffs side-by-side

added added

removed removed

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