diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG index f7b0fa8579cc2c0def56089ecc57f551bd0de7fb..9e0161bf9a2031ef4cf499dc63dd2c02be8caf0b 100644 --- a/sm5/CHANGELOG +++ b/sm5/CHANGELOG @@ -1,6 +1,6 @@ CHANGELOG for smartmontools -$Id: CHANGELOG,v 1.728 2008/09/06 20:08:35 chrfranke Exp $ +$Id: CHANGELOG,v 1.729 2008/09/06 21:11:59 chrfranke Exp $ The most recent version of this file is: http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup @@ -39,6 +39,9 @@ NOTES FOR FUTURE RELEASES: see TODO file. <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> + [CF] smartd: Remove SCSITIMEOUT code. According to smartd.h 1.54 CVS log + from 2003-10-27, it did never work. + [CF] Remove dependencies ataprint.cpp and scsiprint.cpp from smartd. Move common ATA functions from ataprint.cpp to atacmds.cpp. Module scsiprint.cpp was apparently never used in smartd. diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp index 18b7feb4287e5ff6b5e3fe8b6a1c6e74621ded47..815cec7e7ee120ebace26d48b4c5b87bf430a52a 100644 --- a/sm5/smartd.cpp +++ b/sm5/smartd.cpp @@ -45,10 +45,6 @@ #include <vector> #include <algorithm> // std::replace() -#if SCSITIMEOUT -#include <setjmp.h> -#endif - // see which system files to conditionally include #include "config.h" @@ -142,7 +138,7 @@ extern const char *os_solaris_ata_s_cvsid; #ifdef _WIN32 extern const char *daemon_win32_c_cvsid, *hostname_win32_c_cvsid, *syslog_win32_c_cvsid; #endif -const char *smartd_c_cvsid="$Id: smartd.cpp,v 1.419 2008/09/06 20:08:35 chrfranke Exp $" +const char *smartd_c_cvsid="$Id: smartd.cpp,v 1.420 2008/09/06 21:11:59 chrfranke Exp $" ATACMDS_H_CVSID CONFIG_H_CVSID #ifdef DAEMON_WIN32_H_CVSID DAEMON_WIN32_H_CVSID @@ -232,18 +228,6 @@ volatile int caughtsigHUP=0; // set to signal value if we catch INT, QUIT, or TERM volatile int caughtsigEXIT=0; -// Number of seconds to allow for registering a SCSI device. If this -// time expires without sucess or failure, then treat it as failure. -// Set to 0 to eliminate this timeout feature from the code -// (equivalent to an infinite timeout interval). -// TODO: This is no longer implemented. Is it still needed? -#define SCSITIMEOUT 0 - -#if SCSITIMEOUT -// stack environment if we time out during SCSI access (USB devices) -jmp_buf registerscsienv; -#endif - // Number of monitoring flags per Attribute and offsets. // See monitorattflags below. enum { @@ -2489,14 +2473,6 @@ static void CheckDevicesOnce(const dev_config_vector & configs, dev_state_vector } } -#if SCSITIMEOUT -// This alarm means that a SCSI USB device was hanging -void AlarmHandler(int signal) { - longjmp(registerscsienv, 1); -} -#endif - - // Set if Initialize() was called static bool is_initialized = false; @@ -3789,43 +3765,7 @@ static void RegisterDevices(const dev_config_vector & conf_entries, smart_device // or register SCSI devices else if (dev->is_scsi()){ - int retscsi=0; - -#if 0 // SCSITIMEOUT // TODO: Handle in dev_legacy.cpp or os_*.cpp - struct sigaction alarmAction, defaultaction; - - // Set up an alarm handler to catch USB devices that hang on - // SCSI scanning... - alarmAction.sa_handler= AlarmHandler; - alarmAction.sa_flags = SA_RESTART; - if (sigaction(SIGALRM, &alarmAction, &defaultaction)) { - // if we can't set timeout, just scan device - PrintOut(LOG_CRIT, "Unable to initialize SCSI timeout mechanism.\n"); - retscsi=SCSIDeviceScan(ent); - } - else { - // prepare return point in case of bad SCSI device - if (setjmp(registerscsienv)) - // SCSI device timed out! - retscsi=-1; - else { - // Set alarm, make SCSI call, reset alarm - alarm(SCSITIMEOUT); - retscsi=SCSIDeviceScan(ent); - alarm(0); - } - if (sigaction(SIGALRM, &defaultaction, NULL)){ - PrintOut(LOG_CRIT, "Unable to clear SCSI timeout mechanism.\n"); - } - } -#else - retscsi = SCSIDeviceScan(cfg, state, dev->to_scsi()); -#endif - - // Now scan SCSI device... - if (retscsi){ - if (retscsi<0) - PrintOut(LOG_CRIT, "Device %s timed out (poorly-implemented USB device?)\n", cfg.name.c_str()); + if (SCSIDeviceScan(cfg, state, dev->to_scsi())) { CanNotRegister(cfg.name.c_str(), "SCSI", cfg.lineno, scanning); delete dev; dev = 0; }