]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
findmnt: fallback to mountinfo for polling
authorDave Reisner <dreisner@archlinux.org>
Sun, 20 May 2012 00:39:20 +0000 (20:39 -0400)
committerKarel Zak <kzak@redhat.com>
Wed, 23 May 2012 07:56:51 +0000 (09:56 +0200)
If no tabfiles are specified, default to watching /proc/self/mountinfo
rather than exiting silently with EXIT_FAILURE.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
misc-utils/findmnt.c

index 9005483097aab875cc807d23ee65d00e6a597f3a..eab224ab1e5ff2ac1c57f1aedee69b881947fcf0 100644 (file)
@@ -1320,8 +1320,7 @@ int main(int argc, char *argv[])
         */
        if (flags & FL_POLL) {
                /* poll mode (accept the first tabfile only) */
-               if (tabfiles && ntabfiles > 0)
-                       rc = poll_table(tb, *tabfiles, timeout, tt, direction);
+               rc = poll_table(tb, tabfiles ? *tabfiles : _PATH_PROC_MOUNTINFO, timeout, tt, direction);
 
        } else if ((tt_flags & TT_FL_TREE) && is_listall_mode())
                /* whole tree */