From c01242aa428bcbd7efa28b6d4160cf4cfe0a569e Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Fri, 22 Sep 2023 23:08:01 +0200 Subject: [PATCH] Cleanup --- cpp/piscsi/piscsi_core.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cpp/piscsi/piscsi_core.cpp b/cpp/piscsi/piscsi_core.cpp index c1b1019960..69bbe53565 100644 --- a/cpp/piscsi/piscsi_core.cpp +++ b/cpp/piscsi/piscsi_core.cpp @@ -485,11 +485,13 @@ int Piscsi::run(span args) return EXIT_FAILURE; } - // Attach all specified devices - command.set_operation(ATTACH); + if (command.devices_size()) { + // Attach all specified devices + command.set_operation(ATTACH); - if (const CommandContext context(command, locale); !executor->ProcessCmd(context)) { - throw parser_exception("Can't execute " + PbOperation_Name(command.operation())); + if (const CommandContext context(command, locale); !executor->ProcessCmd(context)) { + throw parser_exception("Can't execute " + PbOperation_Name(command.operation())); + } } // Display and log the device list