Skip to content
Snippets Groups Projects
Commit d62c38a1 authored by ballen4705's avatar ballen4705
Browse files

Fixed erroneous error message when doing non-captive self-tests.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@91 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent eb0b9640
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <errno.h> #include <errno.h>
#include "atacmds.h" #include "atacmds.h"
const char *CVSid1="$Id: atacmds.c,v 1.19 2002/10/23 12:24:24 ballen4705 Exp $\n" "\t" CVSID1 ; const char *CVSid1="$Id: atacmds.c,v 1.20 2002/10/23 13:43:42 ballen4705 Exp $\n" "\t" CVSID1 ;
// These Drive Identity tables are taken from hdparm 5.2, and are also // These Drive Identity tables are taken from hdparm 5.2, and are also
// given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note // given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note
...@@ -561,7 +561,7 @@ int ataSmartTest(int device, int testtype){ ...@@ -561,7 +561,7 @@ int ataSmartTest(int device, int testtype){
// Now send the command to test // Now send the command to test
errornum=ioctl(device, HDIO_DRIVE_CMD, parms); errornum=ioctl(device, HDIO_DRIVE_CMD, parms);
if (!(errornum && errno==EIO && (testtype=SHORT_CAPTIVE_SELF_TEST || testtype==EXTEND_CAPTIVE_SELF_TEST))){ if (errornum && !((testtype=SHORT_CAPTIVE_SELF_TEST || testtype==EXTEND_CAPTIVE_SELF_TEST) && errno==EIO)){
char errormsg[128]; char errormsg[128];
sprintf(errormsg,"Command \"%s\" failed",cmdmsg); sprintf(errormsg,"Command \"%s\" failed",cmdmsg);
perror(errormsg); perror(errormsg);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <errno.h> #include <errno.h>
#include "atacmds.h" #include "atacmds.h"
const char *CVSid1="$Id: atacmds.cpp,v 1.19 2002/10/23 12:24:24 ballen4705 Exp $\n" "\t" CVSID1 ; const char *CVSid1="$Id: atacmds.cpp,v 1.20 2002/10/23 13:43:42 ballen4705 Exp $\n" "\t" CVSID1 ;
// These Drive Identity tables are taken from hdparm 5.2, and are also // These Drive Identity tables are taken from hdparm 5.2, and are also
// given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note // given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note
...@@ -561,7 +561,7 @@ int ataSmartTest(int device, int testtype){ ...@@ -561,7 +561,7 @@ int ataSmartTest(int device, int testtype){
// Now send the command to test // Now send the command to test
errornum=ioctl(device, HDIO_DRIVE_CMD, parms); errornum=ioctl(device, HDIO_DRIVE_CMD, parms);
if (!(errornum && errno==EIO && (testtype=SHORT_CAPTIVE_SELF_TEST || testtype==EXTEND_CAPTIVE_SELF_TEST))){ if (errornum && !((testtype=SHORT_CAPTIVE_SELF_TEST || testtype==EXTEND_CAPTIVE_SELF_TEST) && errno==EIO)){
char errormsg[128]; char errormsg[128];
sprintf(errormsg,"Command \"%s\" failed",cmdmsg); sprintf(errormsg,"Command \"%s\" failed",cmdmsg);
perror(errormsg); perror(errormsg);
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "smartctl.h" #include "smartctl.h"
#include "extern.h" #include "extern.h"
const char *CVSid4="$Id: ataprint.c,v 1.26 2002/10/23 12:37:11 ballen4705 Exp $\n" const char *CVSid4="$Id: ataprint.c,v 1.27 2002/10/23 13:43:42 ballen4705 Exp $\n"
"\t" CVSID2 "\t" CVSID3 "\t" CVSID6 ; "\t" CVSID2 "\t" CVSID3 "\t" CVSID6 ;
// Function for printing ASCII byte-swapped strings, skipping white // Function for printing ASCII byte-swapped strings, skipping white
...@@ -665,12 +665,7 @@ int ataPrintSmartSelfTestlog (struct ata_smart_selftestlog data,int allentries){ ...@@ -665,12 +665,7 @@ int ataPrintSmartSelfTestlog (struct ata_smart_selftestlog data,int allentries){
pout("#%2d %s %s %s %8u %s\n",21-i,msgtest,msgstat, pout("#%2d %s %s %s %8u %s\n",21-i,msgtest,msgstat,
percent,log->timestamp,firstlba); percent,log->timestamp,firstlba);
} }
else {
pout("\n");
return retval;
}
} }
pout("\n");
return retval; return retval;
} }
...@@ -1021,6 +1016,7 @@ int ataPrintMain (int fd){ ...@@ -1021,6 +1016,7 @@ int ataPrintMain (int fd){
if (ataPrintSmartSelfTestlog(smartselftest,!quietmode)) if (ataPrintSmartSelfTestlog(smartselftest,!quietmode))
returnval|=FAILLOG; returnval|=FAILLOG;
QUIETOFF; QUIETOFF;
pout("\n");
} }
} }
} }
...@@ -1030,7 +1026,6 @@ int ataPrintMain (int fd){ ...@@ -1030,7 +1026,6 @@ int ataPrintMain (int fd){
return returnval; return returnval;
pout("=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===\n"); pout("=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===\n");
// if doing a self-test, be sure it's supported by the hardware // if doing a self-test, be sure it's supported by the hardware
if (testcase==OFFLINE_FULL_SCAN && !isSupportExecuteOfflineImmediate(smartval)) if (testcase==OFFLINE_FULL_SCAN && !isSupportExecuteOfflineImmediate(smartval))
pout("Warning: device does not support Execute Off-Line Immediate function.\n\n"); pout("Warning: device does not support Execute Off-Line Immediate function.\n\n");
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "smartctl.h" #include "smartctl.h"
#include "extern.h" #include "extern.h"
const char *CVSid4="$Id: ataprint.cpp,v 1.26 2002/10/23 12:37:11 ballen4705 Exp $\n" const char *CVSid4="$Id: ataprint.cpp,v 1.27 2002/10/23 13:43:42 ballen4705 Exp $\n"
"\t" CVSID2 "\t" CVSID3 "\t" CVSID6 ; "\t" CVSID2 "\t" CVSID3 "\t" CVSID6 ;
// Function for printing ASCII byte-swapped strings, skipping white // Function for printing ASCII byte-swapped strings, skipping white
...@@ -665,12 +665,7 @@ int ataPrintSmartSelfTestlog (struct ata_smart_selftestlog data,int allentries){ ...@@ -665,12 +665,7 @@ int ataPrintSmartSelfTestlog (struct ata_smart_selftestlog data,int allentries){
pout("#%2d %s %s %s %8u %s\n",21-i,msgtest,msgstat, pout("#%2d %s %s %s %8u %s\n",21-i,msgtest,msgstat,
percent,log->timestamp,firstlba); percent,log->timestamp,firstlba);
} }
else {
pout("\n");
return retval;
}
} }
pout("\n");
return retval; return retval;
} }
...@@ -1021,6 +1016,7 @@ int ataPrintMain (int fd){ ...@@ -1021,6 +1016,7 @@ int ataPrintMain (int fd){
if (ataPrintSmartSelfTestlog(smartselftest,!quietmode)) if (ataPrintSmartSelfTestlog(smartselftest,!quietmode))
returnval|=FAILLOG; returnval|=FAILLOG;
QUIETOFF; QUIETOFF;
pout("\n");
} }
} }
} }
...@@ -1030,7 +1026,6 @@ int ataPrintMain (int fd){ ...@@ -1030,7 +1026,6 @@ int ataPrintMain (int fd){
return returnval; return returnval;
pout("=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===\n"); pout("=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===\n");
// if doing a self-test, be sure it's supported by the hardware // if doing a self-test, be sure it's supported by the hardware
if (testcase==OFFLINE_FULL_SCAN && !isSupportExecuteOfflineImmediate(smartval)) if (testcase==OFFLINE_FULL_SCAN && !isSupportExecuteOfflineImmediate(smartval))
pout("Warning: device does not support Execute Off-Line Immediate function.\n\n"); pout("Warning: device does not support Execute Off-Line Immediate function.\n\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment