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

Make sure to close all open file descriptors after forking, and before looking

for new devices.  Don't register devices that do not have all needed SMART capability.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@116 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent a1941123
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.27 2002/10/24 15:25:27 ballen4705 Exp $" const char *CVSid3="$Id: smartd.c,v 1.28 2002/10/24 15:29:05 ballen4705 Exp $"
CVSID1 CVSID4 CVSID7; CVSID1 CVSID4 CVSID7;
int daemon_init(void){ int daemon_init(void){
...@@ -458,11 +458,14 @@ int main (int argc, char **argv){ ...@@ -458,11 +458,14 @@ int main (int argc, char **argv){
printhead(); printhead();
// If we are running in background as a daemon, call
// a routines that forks then closes file descriptors.
if (!debugmode){ if (!debugmode){
daemon_init(); daemon_init();
} }
/* fork into independent process */ // routines that look for devices on ata and scsi bus
atadevicescan (atadevicesptr); atadevicescan (atadevicesptr);
scsidevicescan (scsidevicesptr); scsidevicescan (scsidevicesptr);
......
...@@ -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.27 2002/10/24 15:25:27 ballen4705 Exp $" const char *CVSid3="$Id: smartd.cpp,v 1.28 2002/10/24 15:29:05 ballen4705 Exp $"
CVSID1 CVSID4 CVSID7; CVSID1 CVSID4 CVSID7;
int daemon_init(void){ int daemon_init(void){
...@@ -458,11 +458,14 @@ int main (int argc, char **argv){ ...@@ -458,11 +458,14 @@ int main (int argc, char **argv){
printhead(); printhead();
// If we are running in background as a daemon, call
// a routines that forks then closes file descriptors.
if (!debugmode){ if (!debugmode){
daemon_init(); daemon_init();
} }
/* fork into independent process */ // routines that look for devices on ata and scsi bus
atadevicescan (atadevicesptr); atadevicescan (atadevicesptr);
scsidevicescan (scsidevicesptr); scsidevicescan (scsidevicesptr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment