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
......@@ -37,7 +37,7 @@
#include "ataprint.h"
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;
int daemon_init(void){
......@@ -457,12 +457,15 @@ int main (int argc, char **argv){
}
printhead();
// If we are running in background as a daemon, call
// a routines that forks then closes file descriptors.
if (!debugmode){
daemon_init();
}
/* fork into independent process */
// routines that look for devices on ata and scsi bus
atadevicescan (atadevicesptr);
scsidevicescan (scsidevicesptr);
......
......@@ -37,7 +37,7 @@
#include "ataprint.h"
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;
int daemon_init(void){
......@@ -457,12 +457,15 @@ int main (int argc, char **argv){
}
printhead();
// If we are running in background as a daemon, call
// a routines that forks then closes file descriptors.
if (!debugmode){
daemon_init();
}
/* fork into independent process */
// routines that look for devices on ata and scsi bus
atadevicescan (atadevicesptr);
scsidevicescan (scsidevicesptr);
......
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