From 36dee614f1b7c162acb98eb32497bfd8b8890731 Mon Sep 17 00:00:00 2001 From: ballen4705 <ballen4705@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Sat, 26 Oct 2002 09:38:26 +0000 Subject: [PATCH] Eliminated .fd file descriptor field from data structures. No longer used. git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@138 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- sm5/CHANGELOG | 5 +++-- sm5/smartd.c | 4 +--- sm5/smartd.cpp | 4 +--- sm5/smartd.h | 4 +--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG index d3ddd3bd0..72d728848 100644 --- a/sm5/CHANGELOG +++ b/sm5/CHANGELOG @@ -1,6 +1,6 @@ CHANGELOG for smartmontools -$Id: CHANGELOG,v 1.23 2002/10/26 09:24:26 ballen4705 Exp $ +$Id: CHANGELOG,v 1.24 2002/10/26 09:38:26 ballen4705 Exp $ Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net> @@ -42,7 +42,8 @@ smartmontools-5.0-VERSION since the fd to the device was open. smartd now opens the device when it needs to read values, then closes it. Also, if one time around it can't open the device, it simply prints a warning - message but does not give up. + message but does not give up. Have eliminated the .fd field from + data structures -- no longer gets used. smartd now opens SCSI devices as well using O_RDONLY rather than O_RDWR. If someone can no longer monitor a SCSI device that used diff --git a/sm5/smartd.c b/sm5/smartd.c index 7944644f2..1e041e38b 100644 --- a/sm5/smartd.c +++ b/sm5/smartd.c @@ -39,7 +39,7 @@ // CVS ID strings extern const char *CVSid1, *CVSid2; -const char *CVSid3="$Id: smartd.c,v 1.32 2002/10/26 09:24:26 ballen4705 Exp $" +const char *CVSid3="$Id: smartd.c,v 1.33 2002/10/26 09:38:26 ballen4705 Exp $" CVSID1 CVSID4 CVSID7; // This function prints either to stdout or to the syslog as needed @@ -185,7 +185,6 @@ int atadevicescan (atadevices_t *devices, char *device){ } printout(LOG_INFO,"%s Found and is SMART capable. Adding to \"monitor\" list.\n",device); - devices[numatadevices].fd = fd; strcpy(devices[numatadevices].devicename, device); devices[numatadevices].drive = drive; @@ -244,7 +243,6 @@ int scsidevicescan (scsidevices_t *devices, char *device){ // now we can proceed to register the device printout(LOG_INFO, "Device: %s, Found and is SMART capable. Adding to \"monitor\" list.\n",device); - devices[numscsidevices].fd = fd; strcpy(devices[numscsidevices].devicename,device); // register the supported functionality. The smartd code does not diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp index f376bbfdf..5651802da 100644 --- a/sm5/smartd.cpp +++ b/sm5/smartd.cpp @@ -39,7 +39,7 @@ // CVS ID strings extern const char *CVSid1, *CVSid2; -const char *CVSid3="$Id: smartd.cpp,v 1.32 2002/10/26 09:24:26 ballen4705 Exp $" +const char *CVSid3="$Id: smartd.cpp,v 1.33 2002/10/26 09:38:26 ballen4705 Exp $" CVSID1 CVSID4 CVSID7; // This function prints either to stdout or to the syslog as needed @@ -185,7 +185,6 @@ int atadevicescan (atadevices_t *devices, char *device){ } printout(LOG_INFO,"%s Found and is SMART capable. Adding to \"monitor\" list.\n",device); - devices[numatadevices].fd = fd; strcpy(devices[numatadevices].devicename, device); devices[numatadevices].drive = drive; @@ -244,7 +243,6 @@ int scsidevicescan (scsidevices_t *devices, char *device){ // now we can proceed to register the device printout(LOG_INFO, "Device: %s, Found and is SMART capable. Adding to \"monitor\" list.\n",device); - devices[numscsidevices].fd = fd; strcpy(devices[numscsidevices].devicename,device); // register the supported functionality. The smartd code does not diff --git a/sm5/smartd.h b/sm5/smartd.h index 74fdb9765..64e223941 100644 --- a/sm5/smartd.h +++ b/sm5/smartd.h @@ -23,7 +23,7 @@ */ #ifndef CVSID7 -#define CVSID7 "$Id: smartd.h,v 1.9 2002/10/26 09:24:26 ballen4705 Exp $\n" +#define CVSID7 "$Id: smartd.h,v 1.10 2002/10/26 09:38:26 ballen4705 Exp $\n" #endif // Configuration file @@ -57,7 +57,6 @@ unsigned char emailnotification = FALSE; unsigned char printcopyleft = FALSE; typedef struct atadevices_s { - int fd; int selftest; struct hd_driveid drive; struct ata_smart_values smartval; @@ -66,7 +65,6 @@ typedef struct atadevices_s { } atadevices_t; typedef struct scsidevices_s { - int fd; unsigned char SmartPageSupported; unsigned char TempPageSupported; unsigned char Temperature; -- GitLab