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
......@@ -37,7 +37,7 @@
#include "ataprint.h"
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;
int daemon_init(void){
......@@ -101,9 +101,10 @@ void pout(char *fmt, ...){
void printhead(){
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,PROJECTHOME);
printout(LOG_INFO,"smartd version %d.%d-%d - S.M.A.R.T. Daemon.\n",
RELEASE_MAJOR, RELEASE_MINOR, SMARTMONTOOLS_VERSION);
printout(LOG_INFO,"Home page is %s\n\n",PROJECTHOME);
return;
}
/* prints help information for command syntax */
......@@ -321,19 +322,24 @@ int scsiCheckDevice( scsidevices_t *drive)
return 0;
}
void CheckDevices ( atadevices_t *atadevices, scsidevices_t *scsidevices)
{
int i;
while (1){
for (i = 0; i < numatadevices;i++)
ataCheckDevice ( &atadevices[i]);
for (i = 0; i < numscsidevices;i++)
scsiCheckDevice ( &scsidevices[i]);
sleep ( checktime );
}
void CheckDevices ( atadevices_t *atadevices, scsidevices_t *scsidevices){
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){
for (i = 0; i < numatadevices;i++)
ataCheckDevice ( &atadevices[i]);
for (i = 0; i < numscsidevices;i++)
scsiCheckDevice ( &scsidevices[i]);
sleep ( checktime );
}
}
......
......@@ -37,7 +37,7 @@
#include "ataprint.h"
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;
int daemon_init(void){
......@@ -101,9 +101,10 @@ void pout(char *fmt, ...){
void printhead(){
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,PROJECTHOME);
printout(LOG_INFO,"smartd version %d.%d-%d - S.M.A.R.T. Daemon.\n",
RELEASE_MAJOR, RELEASE_MINOR, SMARTMONTOOLS_VERSION);
printout(LOG_INFO,"Home page is %s\n\n",PROJECTHOME);
return;
}
/* prints help information for command syntax */
......@@ -321,19 +322,24 @@ int scsiCheckDevice( scsidevices_t *drive)
return 0;
}
void CheckDevices ( atadevices_t *atadevices, scsidevices_t *scsidevices)
{
int i;
while (1){
for (i = 0; i < numatadevices;i++)
ataCheckDevice ( &atadevices[i]);
for (i = 0; i < numscsidevices;i++)
scsiCheckDevice ( &scsidevices[i]);
sleep ( checktime );
}
void CheckDevices ( atadevices_t *atadevices, scsidevices_t *scsidevices){
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){
for (i = 0; i < numatadevices;i++)
ataCheckDevice ( &atadevices[i]);
for (i = 0; i < numscsidevices;i++)
scsiCheckDevice ( &scsidevices[i]);
sleep ( checktime );
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment