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

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.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@455 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 660ebe28
No related branches found
No related tags found
No related merge requests found
CHANGELOG for smartmontools 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> Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
...@@ -33,6 +33,13 @@ NOTES FOR FUTURE RELEASES: see TODO file. ...@@ -33,6 +33,13 @@ NOTES FOR FUTURE RELEASES: see TODO file.
CURRENT RELEASE (see VERSION file in this directory): 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 [BA] Modified printing format for 9,minutes to read
Xh+Ym not X h + Y m, so that fields are fixed width. Xh+Ym not X h + Y m, so that fields are fixed width.
......
3 4
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "extern.h" #include "extern.h"
#include "utility.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; ATACMDS_H_CVSID ATAPRINT_H_CVSID EXTERN_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID;
// for passing global control variables // for passing global control variables
...@@ -506,7 +506,7 @@ int nonempty(unsigned char *testarea,int n){ ...@@ -506,7 +506,7 @@ int nonempty(unsigned char *testarea,int n){
} }
// returns number of errors // returns number of errors
void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ int ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
int i,j,k; int i,j,k;
pout("SMART Error Log Version: %d\n", (int)data->revnumber); pout("SMART Error Log Version: %d\n", (int)data->revnumber);
...@@ -514,7 +514,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -514,7 +514,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
// if no errors logged, return // if no errors logged, return
if (!data->error_log_pointer){ if (!data->error_log_pointer){
pout("No Errors Logged\n\n"); pout("No Errors Logged\n\n");
return; return 0;
} }
QUIETON(con); QUIETON(con);
// If log pointer out of range, return // If log pointer out of range, return
...@@ -522,7 +522,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -522,7 +522,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
pout("Invalid Error Log index = %02x (T13/1321D rev 1c" 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", "Section 8.41.6.8.2.2 gives valid range from 1 to 5)\n\n",
(int)data->error_log_pointer); (int)data->error_log_pointer);
return; return 0;
} }
// Some internal consistency checking of the data structures // Some internal consistency checking of the data structures
...@@ -609,7 +609,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -609,7 +609,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
if (con->quietmode) if (con->quietmode)
pout("\n"); pout("\n");
QUIETOFF(con); QUIETOFF(con);
return; return data->ata_error_count;
} }
// return value is number of entries found where the self-test showed an error // return value is number of entries found where the self-test showed an error
...@@ -972,7 +972,8 @@ int ataPrintMain (int fd){ ...@@ -972,7 +972,8 @@ int ataPrintMain (int fd){
} }
else { else {
// quiet mode is turned on inside ataPrintSmartErrorLog() // quiet mode is turned on inside ataPrintSmartErrorLog()
ataPrintSmartErrorlog(&smarterror); if (ataPrintSmartErrorlog(&smarterror))
returnval|=FAILERR;
QUIETOFF(con); QUIETOFF(con);
} }
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "extern.h" #include "extern.h"
#include "utility.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; ATACMDS_H_CVSID ATAPRINT_H_CVSID EXTERN_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID;
// for passing global control variables // for passing global control variables
...@@ -506,7 +506,7 @@ int nonempty(unsigned char *testarea,int n){ ...@@ -506,7 +506,7 @@ int nonempty(unsigned char *testarea,int n){
} }
// returns number of errors // returns number of errors
void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ int ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
int i,j,k; int i,j,k;
pout("SMART Error Log Version: %d\n", (int)data->revnumber); pout("SMART Error Log Version: %d\n", (int)data->revnumber);
...@@ -514,7 +514,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -514,7 +514,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
// if no errors logged, return // if no errors logged, return
if (!data->error_log_pointer){ if (!data->error_log_pointer){
pout("No Errors Logged\n\n"); pout("No Errors Logged\n\n");
return; return 0;
} }
QUIETON(con); QUIETON(con);
// If log pointer out of range, return // If log pointer out of range, return
...@@ -522,7 +522,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -522,7 +522,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
pout("Invalid Error Log index = %02x (T13/1321D rev 1c" 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", "Section 8.41.6.8.2.2 gives valid range from 1 to 5)\n\n",
(int)data->error_log_pointer); (int)data->error_log_pointer);
return; return 0;
} }
// Some internal consistency checking of the data structures // Some internal consistency checking of the data structures
...@@ -609,7 +609,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){ ...@@ -609,7 +609,7 @@ void ataPrintSmartErrorlog (struct ata_smart_errorlog *data){
if (con->quietmode) if (con->quietmode)
pout("\n"); pout("\n");
QUIETOFF(con); QUIETOFF(con);
return; return data->ata_error_count;
} }
// return value is number of entries found where the self-test showed an error // return value is number of entries found where the self-test showed an error
...@@ -972,7 +972,8 @@ int ataPrintMain (int fd){ ...@@ -972,7 +972,8 @@ int ataPrintMain (int fd){
} }
else { else {
// quiet mode is turned on inside ataPrintSmartErrorLog() // quiet mode is turned on inside ataPrintSmartErrorLog()
ataPrintSmartErrorlog(&smarterror); if (ataPrintSmartErrorlog(&smarterror))
returnval|=FAILERR;
QUIETOFF(con); QUIETOFF(con);
} }
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define _SMART_PRINT_H_ #define _SMART_PRINT_H_
#ifndef ATAPRINT_H_CVSID #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 #endif
#include <stdio.h> #include <stdio.h>
...@@ -46,7 +46,8 @@ void ataPrintGeneralSmartValues(struct ata_smart_values *); ...@@ -46,7 +46,8 @@ void ataPrintGeneralSmartValues(struct ata_smart_values *);
void ataPrintSmartThresholds(struct ata_smart_thresholds *); 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); void PrintSmartAttributes(struct ata_smart_values *data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment