]> 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>
Thu, 24 May 2012 10:45:56 +0000 (12:45 +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 dbfbb30551796d356fe6be956068a8b43aa13ef2..7b7eb3530c770b2ec68ffe4ce3de165b899de3e0 100644 (file)
@@ -1151,8 +1151,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 */