Skip to content
This repository
Browse code

findmnt: fallback to mountinfo for polling

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>
  • Loading branch information...
commit b8a670aecf21645869f2d9c72469607462829fc8 1 parent beda9dd
Dave Reisner authored karelzak committed

Showing 1 changed file with 1 addition and 2 deletions. Show diff stats Hide diff stats

  1. 3  misc-utils/findmnt.c
3  misc-utils/findmnt.c
@@ -1320,8 +1320,7 @@ int main(int argc, char *argv[])
1320 1320
 	 */
1321 1321
 	if (flags & FL_POLL) {
1322 1322
 		/* poll mode (accept the first tabfile only) */
1323  
-		if (tabfiles && ntabfiles > 0)
1324  
-			rc = poll_table(tb, *tabfiles, timeout, tt, direction);
  1323
+		rc = poll_table(tb, tabfiles ? *tabfiles : _PATH_PROC_MOUNTINFO, timeout, tt, direction);
1325 1324
 
1326 1325
 	} else if ((tt_flags & TT_FL_TREE) && is_listall_mode())
1327 1326
 		/* whole tree */

0 notes on commit b8a670a

Please sign in to comment.
Something went wrong with that request. Please try again.