From ee3a4ef853825b68af02db40eaa82ad67c17fe9e Mon Sep 17 00:00:00 2001 From: ballen4705 <ballen4705@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Tue, 17 Aug 2004 16:17:25 +0000 Subject: [PATCH] Add default branch to switch statement git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/branches/unlabeled-1.134.2@1876 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- sm5/smartctl.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sm5/smartctl.cpp b/sm5/smartctl.cpp index ffb6272b0..f8e1765e9 100644 --- a/sm5/smartctl.cpp +++ b/sm5/smartctl.cpp @@ -51,7 +51,7 @@ extern const char *os_solaris_ata_s_cvsid; extern const char *int64_vc6_c_cvsid; #endif extern const char *atacmdnames_c_cvsid, *atacmds_c_cvsid, *ataprint_c_cvsid, *knowndrives_c_cvsid, *os_XXXX_c_cvsid, *scsicmds_c_cvsid, *scsiprint_c_cvsid, *utility_c_cvsid; -const char* smartctl_c_cvsid="$Id: smartctl.cpp,v 1.134.2.2 2004/08/17 00:06:18 ballen4705 Exp $" +const char* smartctl_c_cvsid="$Id: smartctl.cpp,v 1.134.2.3 2004/08/17 16:17:25 ballen4705 Exp $" ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SCSICMDS_H_CVSID SCSIPRINT_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID; // This is a block containing all the "control variables". We declare @@ -872,20 +872,18 @@ int main (int argc, char **argv){ // now call appropriate ATA or SCSI routine switch (con->controller_type) { - case CONTROLLER_ATA: - case CONTROLLER_3WARE_678K: - case CONTROLLER_3WARE_9000_CHAR: - case CONTROLLER_3WARE_678K_CHAR: - case CONTROLLER_MARVELL_SATA: - retval = ataPrintMain(fd); + case CONTROLLER_UNKNOWN: + // we should never fall into this branch! + pout("Smartctl: please specify device type with the -d option.\n"); + UsageSummary(); + retval = FAILCMD; break; case CONTROLLER_SCSI: retval = scsiPrintMain(fd); break; default: - pout("Smartctl: please specify device type with the -d option.\n"); - UsageSummary(); - return FAILCMD; + retval = ataPrintMain(fd); + break; } return retval; -- GitLab