~ubuntu-branches/ubuntu/trusty/util-linux/trusty-proposed

« back to all changes in this revision

Viewing changes to mount/fstab.c

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2011-11-03 15:38:23 UTC
  • mto: (4.5.5 sid) (1.6.4)
  • mto: This revision was merged to the branch mainline in revision 85.
  • Revision ID: package-import@ubuntu.com-20111103153823-10sx16jprzxlhkqf
ImportĀ upstreamĀ versionĀ 2.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
        mc0 = mtab_head();
273
273
        if (!mcprev)
274
274
                mcprev = mc0;
275
 
        for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev)
276
 
                if (streq(mc->m.mnt_dir, name) ||
277
 
                    streq(mc->m.mnt_fsname, name))
278
 
                        return mc;
 
275
 
 
276
        for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev)
 
277
                if (streq(mc->m.mnt_dir, name))
 
278
                        return mc;
 
279
 
 
280
        for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev)
 
281
                if (streq(mc->m.mnt_fsname, name))
 
282
                        return mc;
 
283
 
279
284
        return NULL;
280
285
}
281
286
 
455
460
 
456
461
        cdir = canonicalize(dir);
457
462
        for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) {
458
 
                if (streq(mc->m.mnt_dir, cdir)) {
 
463
                int ok = streq(mc->m.mnt_dir, cdir);
 
464
                if (!ok) {
 
465
                        char *dr = canonicalize(mc->m.mnt_dir);
 
466
                        ok = dr ? streq(dr, cdir) : 0;
 
467
                        free(dr);
 
468
                }
 
469
                if (ok) {
459
470
                        free(cdir);
460
471
                        return mc;
461
472
                }
574
585
}
575
586
 
576
587
static void
577
 
setlkw_timeout (int sig) {
 
588
setlkw_timeout (int sig __attribute__ ((__unused__))) {
578
589
     /* nothing, fcntl will fail anyway */
579
590
}
580
591
 
769
780
                return NULL;
770
781
 
771
782
        end = strchr(opt, ',');
772
 
        sz = end ? end - opt : strlen(opt);
 
783
        sz = end && end > opt ? (size_t) (end - opt) : strlen(opt);
773
784
 
774
785
        if (len)
775
786
                *len = sz;