From 275c9a4849f5edf92ed0d95ea2b97a5a69a34d26 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Feb 2012 00:05:24 +0100 Subject: [PATCH] findmnt: make --poll more robust Signed-off-by: Karel Zak --- config/include-Makefile.am | 2 +- misc-utils/findmnt.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/include-Makefile.am b/config/include-Makefile.am index 300fe4de16..29760d42f5 100644 --- a/config/include-Makefile.am +++ b/config/include-Makefile.am @@ -47,4 +47,4 @@ $(ul_libmount_la): # smatch scan -- smatch and cgcc are expected in $PATH # checksmatch: - $(MAKE) CHECK="smatch --data=$(top_srcdir)/tools/smatch-data" CC=cgcc + $(MAKE) CHECK="smatch --data=$(abs_top_srcdir)/tools/smatch-data" CC=cgcc diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 083cfea2ca..4a65df990b 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -1150,11 +1150,12 @@ int main(int argc, char *argv[]) /* * Fill in data to the output table */ - if (flags & FL_POLL) + if (flags & FL_POLL) { /* poll mode (accept the first tabfile only) */ - rc = poll_table(tb, *tabfiles, timeout, tt, direction); + if (tabfiles && ntabfiles > 0) + rc = poll_table(tb, *tabfiles, timeout, tt, direction); - else if ((tt_flags & TT_FL_TREE) && is_listall_mode()) + } else if ((tt_flags & TT_FL_TREE) && is_listall_mode()) /* whole tree */ rc = create_treenode(tt, tb, NULL, NULL); else -- 2.47.3