diff -Nur mlocate-0.24/src/updatedb.c a/src/updatedb.c --- mlocate-0.24/src/updatedb.c 2011-03-30 05:58:33.000000000 +0800 +++ a/src/updatedb.c 2011-08-01 22:06:08.046434390 +0800 @@ -337,10 +337,12 @@ struct mntent *me; bool res; + char *dir; + if (conf_debug_pruning != false) /* This is debuging output, don't mark anything for translation */ fprintf (stderr, "Checking whether filesystem `%s' is excluded:\n", path); - res = false; + res = true; f = setmntent (MOUNT_TABLE_PATH, "r"); if (f == NULL) goto err; @@ -349,9 +351,25 @@ char *p; size_t size; +#ifndef PROC_MOUNTS_PATH + char dbuf[PATH_MAX]; + + dir = realpath (me->mnt_dir, dbuf); + if (dir == NULL) + dir = me->mnt_dir; +#else + /* Paths in /proc/self/mounts contain no symbolic links. Besides + avoiding a few system calls, avoiding the realpath () avoids hangs + if the filesystem is unavailable hard-mounted NFS. */ + dir = me->mnt_dir; +#endif + if (conf_debug_pruning != false) /* This is debuging output, don't mark anything for translation */ - fprintf (stderr, " `%s', type `%s'\n", me->mnt_dir, me->mnt_type); + fprintf (stderr, " `%s', type `%s' (%d)\n", dir, me->mnt_type); + if (strcmp (path, dir) != 0) + continue; + size = strlen (me->mnt_type) + 1; while (size > type_size) type = x2realloc (type, &type_size); @@ -361,29 +379,19 @@ if (bsearch (type, conf_prunefs.entries, conf_prunefs.len, sizeof (*conf_prunefs.entries), cmp_string_pointer) != NULL) { - char *dir; -#ifndef PROC_MOUNTS_PATH - char dbuf[PATH_MAX]; - - dir = realpath (me->mnt_dir, dbuf); - if (dir == NULL) - dir = me->mnt_dir; -#else - /* Paths in /proc/self/mounts contain no symbolic links. Besides - avoiding a few system calls, avoiding the realpath () avoids hangs - if the filesystem is unavailable hard-mounted NFS. */ - dir = me->mnt_dir; -#endif if (conf_debug_pruning != false) /* This is debuging output, don't mark anything for translation */ fprintf (stderr, " => type matches, dir `%s'\n", dir); - if (strcmp (path, dir) == 0) - { - res = true; - goto err_f; - } + } + else + { + res = false; + /* This is debuging output, don't mark anything for translation */ + fprintf (stderr, " usable candidate found `%s'\n", dir); + goto err_f; } } + err_f: endmntent (f); err: