--- util-linux/blkid.c +++ util-linux/blkid.c @@ -38,14 +38,18 @@ int blkid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int blkid_main(int argc UNUSED_PARAM, char **argv) { + int part_found = 0; int scan_devices = 1; while (*++argv) { /* Note: bogus device names don't cause any error messages */ - add_to_uuid_cache(*argv); + if (add_to_uuid_cache(*argv)) + part_found = 1; // at least data for one partition found scan_devices = 0; } - display_uuid_cache(scan_devices); + // show all partitions only, if blkid called without arguments or if uuidCache not empty + if (scan_devices || part_found) + display_uuid_cache(scan_devices); return 0; }