]> granicus.if.org Git - sysstat/commitdiff
iostat: Fix issue when a UUID is given on the command line
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 20 Jul 2019 08:28:16 +0000 (10:28 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 20 Jul 2019 08:28:16 +0000 (10:28 +0200)
A command like "iostat -j UUID 2578463f-6947-48c7-8b09-876a4145cfb1 1 2"
didn't work because the UUID name was considered as the interval of time
to use. This patch fixes the problem.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
iostat.c

index cbb586e4494016f2552a9e9812165dd30e2e7b7d..153462fd4d0444fc51b139d7d1b9946062a61b40 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -2033,7 +2033,7 @@ int main(int argc, char **argv)
                        opt++;
                }
 
-               else if (!isdigit(argv[opt][0])) {
+               else if (strspn(argv[opt], DIGITS) != strlen(argv[opt])) {
                        /*
                         * By default iostat doesn't display unused devices.
                         * If some devices are explicitly entered on the command line