diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG index fa9d22b7d5fd34f129a62e0ff1956a91fce57ea5..e7d28c92f404abb1836b73b694f2d70e03f15bd1 100644 --- a/sm5/CHANGELOG +++ b/sm5/CHANGELOG @@ -1,6 +1,6 @@ CHANGELOG for smartmontools -$Id: CHANGELOG,v 1.86 2003/01/14 20:04:03 ballen4705 Exp $ +$Id: CHANGELOG,v 1.87 2003/01/17 21:47:06 ballen4705 Exp $ Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net> @@ -33,6 +33,13 @@ NOTES FOR FUTURE RELEASES: see TODO file. CURRENT RELEASE (see VERSION file in this directory): + [BA] Fixed bug in smartctl pointed out by Gregory Goddard + <ggoddard@ufl.edu>. Manual says that bit 6 of return + value turned on if errors found in smart error log. But + this wasn't implemented. + +smartmontools-5.1-3 + [BA] Modified printing format for 9,minutes to read Xh+Ym not X h + Y m, so that fields are fixed width. diff --git a/sm5/VERSION b/sm5/VERSION index 00750edc07d6415dcc07ae0351e9397b0222b7ba..b8626c4cff2849624fb67f87cd0ad72b163671ad 100644 --- a/sm5/VERSION +++ b/sm5/VERSION @@ -1 +1 @@ -3 +4 diff --git a/sm5/ataprint.c b/sm5/ataprint.c index 2a520d57716da0591ea4a6a5c32601979cacfa63..7b64d2044f4279413ead28e99a41728dd62b9fa6 100644 --- a/sm5/ataprint.c +++ b/sm5/ataprint.c @@ -31,7 +31,7 @@ #include "extern.h" #include "utility.h" -const char *ataprint_c_cvsid="$Id: ataprint.c,v 1.55 2003/01/16 15:28:57 ballen4705 Exp $" +const char *ataprint_c_cvsid="$Id: ataprint.c,v 1.56 2003/01/17 21:47:12 ballen4705 Exp $" ATACMDS_H_CVSID ATAPRINT_H_CVSID EXTERN_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID; // for passing global control variables @@ -506,7 +506,7 @@ int nonempty(unsigned char *testarea,int n){ } // returns number of errors -void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ +int ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ int i,j,k; pout("SMART Error Log Version: %d\n", (int)data->revnumber); @@ -514,7 +514,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ // if no errors logged, return if (!data->error_log_pointer){ pout("No Errors Logged\n\n"); - return; + return 0; } QUIETON(con); // If log pointer out of range, return @@ -522,7 +522,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ pout("Invalid Error Log index = %02x (T13/1321D rev 1c" "Section 8.41.6.8.2.2 gives valid range from 1 to 5)\n\n", (int)data->error_log_pointer); - return; + return 0; } // Some internal consistency checking of the data structures @@ -609,7 +609,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ if (con->quietmode) pout("\n"); QUIETOFF(con); - return; + return data->ata_error_count; } // return value is number of entries found where the self-test showed an error @@ -972,7 +972,8 @@ int ataPrintMain (int fd){ } else { // quiet mode is turned on inside ataPrintSmartErrorLog() - ataPrintSmartErrorlog(&smarterror); + if (ataPrintSmartErrorlog(&smarterror)) + returnval|=FAILERR; QUIETOFF(con); } } diff --git a/sm5/ataprint.cpp b/sm5/ataprint.cpp index 34f3f13d7e87fa3fdd1c44e7bb436ee6b0bf3123..dcaa00257c54c3d008d848d37101c126e8abe927 100644 --- a/sm5/ataprint.cpp +++ b/sm5/ataprint.cpp @@ -31,7 +31,7 @@ #include "extern.h" #include "utility.h" -const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.55 2003/01/16 15:28:57 ballen4705 Exp $" +const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.56 2003/01/17 21:47:12 ballen4705 Exp $" ATACMDS_H_CVSID ATAPRINT_H_CVSID EXTERN_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID; // for passing global control variables @@ -506,7 +506,7 @@ int nonempty(unsigned char *testarea,int n){ } // returns number of errors -void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ +int ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ int i,j,k; pout("SMART Error Log Version: %d\n", (int)data->revnumber); @@ -514,7 +514,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ // if no errors logged, return if (!data->error_log_pointer){ pout("No Errors Logged\n\n"); - return; + return 0; } QUIETON(con); // If log pointer out of range, return @@ -522,7 +522,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ pout("Invalid Error Log index = %02x (T13/1321D rev 1c" "Section 8.41.6.8.2.2 gives valid range from 1 to 5)\n\n", (int)data->error_log_pointer); - return; + return 0; } // Some internal consistency checking of the data structures @@ -609,7 +609,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ if (con->quietmode) pout("\n"); QUIETOFF(con); - return; + return data->ata_error_count; } // return value is number of entries found where the self-test showed an error @@ -972,7 +972,8 @@ int ataPrintMain (int fd){ } else { // quiet mode is turned on inside ataPrintSmartErrorLog() - ataPrintSmartErrorlog(&smarterror); + if (ataPrintSmartErrorlog(&smarterror)) + returnval|=FAILERR; QUIETOFF(con); } } diff --git a/sm5/ataprint.h b/sm5/ataprint.h index 309b2db6a2c5445ff61cf03830ddf24c82cd6089..42db7d4415f62aa22cef60d64165170ca7b56358 100644 --- a/sm5/ataprint.h +++ b/sm5/ataprint.h @@ -26,7 +26,7 @@ #define _SMART_PRINT_H_ #ifndef ATAPRINT_H_CVSID -#define ATAPRINT_H_CVSID "$Id: ataprint.h,v 1.15 2003/01/16 15:28:57 ballen4705 Exp $\n" +#define ATAPRINT_H_CVSID "$Id: ataprint.h,v 1.16 2003/01/17 21:47:17 ballen4705 Exp $\n" #endif #include <stdio.h> @@ -46,7 +46,8 @@ void ataPrintGeneralSmartValues(struct ata_smart_values *); void ataPrintSmartThresholds(struct ata_smart_thresholds *); -void ataPrintSmartErrorlog(struct ata_smart_errorlog *); +// returns number of errors in Errorlog +int ataPrintSmartErrorlog(struct ata_smart_errorlog *); void PrintSmartAttributes(struct ata_smart_values *data);