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

Modified to exit if no devices found, and to print start-up message showing

how many devices are being monitored.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@117 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 1194e7f8
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "ataprint.h" #include "ataprint.h"
extern const char *CVSid1, *CVSid2; extern const char *CVSid1, *CVSid2;
const char *CVSid3="$Id: smartd.c,v 1.28 2002/10/24 15:29:05 ballen4705 Exp $" const char *CVSid3="$Id: smartd.c,v 1.29 2002/10/24 17:15:25 ballen4705 Exp $"
CVSID1 CVSID4 CVSID7; CVSID1 CVSID4 CVSID7;
int daemon_init(void){ int daemon_init(void){
...@@ -101,9 +101,10 @@ void pout(char *fmt, ...){ ...@@ -101,9 +101,10 @@ void pout(char *fmt, ...){
void printhead(){ void printhead(){
printout(LOG_INFO,"smartd version %d.%d-%d - S.M.A.R.T. Daemon.\n" printout(LOG_INFO,"smartd version %d.%d-%d - S.M.A.R.T. Daemon.\n",
"Home page is %s\n\n", RELEASE_MAJOR, RELEASE_MINOR, SMARTMONTOOLS_VERSION);
RELEASE_MAJOR, RELEASE_MINOR,SMARTMONTOOLS_VERSION,PROJECTHOME); printout(LOG_INFO,"Home page is %s\n\n",PROJECTHOME);
return;
} }
/* prints help information for command syntax */ /* prints help information for command syntax */
...@@ -321,10 +322,15 @@ int scsiCheckDevice( scsidevices_t *drive) ...@@ -321,10 +322,15 @@ int scsiCheckDevice( scsidevices_t *drive)
return 0; return 0;
} }
void CheckDevices ( atadevices_t *atadevices, scsidevices_t *scsidevices) void CheckDevices ( atadevices_t *atadevices, scsidevices_t *scsidevices){
{
int i; int i;
if (!numatadevices && !numscsidevices){
printout(LOG_INFO,"Unable to monitor any SMART enabled ATA or SCSI devices.\n");
return;
}
printout(LOG_INFO,"Started monitoring %d ATA and %d SCSI devices\n",numatadevices,numscsidevices);
while (1){ while (1){
for (i = 0; i < numatadevices;i++) for (i = 0; i < numatadevices;i++)
ataCheckDevice ( &atadevices[i]); ataCheckDevice ( &atadevices[i]);
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "ataprint.h" #include "ataprint.h"
extern const char *CVSid1, *CVSid2; extern const char *CVSid1, *CVSid2;
const char *CVSid3="$Id: smartd.cpp,v 1.28 2002/10/24 15:29:05 ballen4705 Exp $" const char *CVSid3="$Id: smartd.cpp,v 1.29 2002/10/24 17:15:25 ballen4705 Exp $"
CVSID1 CVSID4 CVSID7; CVSID1 CVSID4 CVSID7;
int daemon_init(void){ int daemon_init(void){
...@@ -101,9 +101,10 @@ void pout(char *fmt, ...){ ...@@ -101,9 +101,10 @@ void pout(char *fmt, ...){
void printhead(){ void printhead(){
printout(LOG_INFO,"smartd version %d.%d-%d - S.M.A.R.T. Daemon.\n" printout(LOG_INFO,"smartd version %d.%d-%d - S.M.A.R.T. Daemon.\n",
"Home page is %s\n\n", RELEASE_MAJOR, RELEASE_MINOR, SMARTMONTOOLS_VERSION);
RELEASE_MAJOR, RELEASE_MINOR,SMARTMONTOOLS_VERSION,PROJECTHOME); printout(LOG_INFO,"Home page is %s\n\n",PROJECTHOME);
return;
} }
/* prints help information for command syntax */ /* prints help information for command syntax */
...@@ -321,10 +322,15 @@ int scsiCheckDevice( scsidevices_t *drive) ...@@ -321,10 +322,15 @@ int scsiCheckDevice( scsidevices_t *drive)
return 0; return 0;
} }
void CheckDevices ( atadevices_t *atadevices, scsidevices_t *scsidevices) void CheckDevices ( atadevices_t *atadevices, scsidevices_t *scsidevices){
{
int i; int i;
if (!numatadevices && !numscsidevices){
printout(LOG_INFO,"Unable to monitor any SMART enabled ATA or SCSI devices.\n");
return;
}
printout(LOG_INFO,"Started monitoring %d ATA and %d SCSI devices\n",numatadevices,numscsidevices);
while (1){ while (1){
for (i = 0; i < numatadevices;i++) for (i = 0; i < numatadevices;i++)
ataCheckDevice ( &atadevices[i]); ataCheckDevice ( &atadevices[i]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment