blktrace: disallow -o when using multiple devices
[blktrace.git] / blktrace.c
index b9f9b689cf65e5de63dd47eff01281633a61a516..4671a0479f0ea5003c037db2d25572f82d404968 100644 (file)
@@ -2626,6 +2626,12 @@ int main(int argc, char *argv[])
                goto out;
        }
 
+       if (ndevs > 1 && output_name && strcmp(output_name, "-") != 0) {
+               fprintf(stderr, "-o not supported with multiple devices\n");
+               ret = 1;
+               goto out;
+       }
+
        signal(SIGINT, handle_sigint);
        signal(SIGHUP, handle_sigint);
        signal(SIGTERM, handle_sigint);