Skip to content
Snippets Groups Projects
Commit a771a33b authored by guidog's avatar guidog
Browse files

finetune devfs device name matching

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@734 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent be6e9377
No related branches found
No related tags found
No related merge requests found
CHANGELOG for smartmontools
$Id: CHANGELOG,v 1.138 2003/05/06 03:46:23 ballen4705 Exp $
$Id: CHANGELOG,v 1.139 2003/05/06 22:58:01 guidog Exp $
Copyright (C) 2002-3 Bruce Allen <smartmontools-support@lists.sourceforge.net>
......@@ -37,6 +37,8 @@ CURRENT DEVELOPMENT VERSION (see VERSION file in this directory):
<ADDITIONS TO THE CHANGE LOG SHOULD BE ADDED HERE, PLEASE>
[GG] match for scsi/ and ide/ in case of devfs to exclude false postives
[BA] If SCSI device listed in /etc/smartd.conf fails to open or do
SMART stuff correctly, or not enough space
to list all SCSI devices, fail with error unless
......
......@@ -36,7 +36,7 @@
#include "utility.h"
// Any local header files should be represented by a CVSIDX just below.
const char* utility_c_cvsid="$Id: utility.c,v 1.10 2003/05/06 03:24:48 ballen4705 Exp $" UTILITY_H_CVSID;
const char* utility_c_cvsid="$Id: utility.c,v 1.11 2003/05/06 22:58:00 guidog Exp $" UTILITY_H_CVSID;
// Utility function prints date and time and timezone into a character
......@@ -216,8 +216,9 @@ int split_report_arg(char *s, int *i)
// osst, nosst and sg.
static const char * lin_dev_prefix = "/dev/";
static const char * lin_dev_ata_disk_plus = "h";
static const char * lin_dev_ata_devfs_disk_plus = "ide/";
static const char * lin_dev_scsi_devfs_disk_plus = "scsi/";
static const char * lin_dev_scsi_disk_plus = "s";
static const char * lin_dev_ide_plus = "i";
static const char * lin_dev_scsi_tape1 = "ns";
static const char * lin_dev_scsi_tape2 = "os";
static const char * lin_dev_scsi_tape3 = "nos";
......@@ -244,9 +245,9 @@ int guess_linux_device_type(const char * dev_name) {
strlen(lin_dev_ata_disk_plus)))
return GUESS_DEVTYPE_ATA;
// form /dev/i* or i*
if (!strncmp(lin_dev_ide_plus, dev_name,
strlen(lin_dev_ide_plus)))
// form /dev/ide/* or ide/*
if (!strncmp(lin_dev_ata_devfs_disk_plus, dev_name,
strlen(lin_dev_ata_devfs_disk_plus)))
return GUESS_DEVTYPE_ATA;
// form /dev/s* or s*
......@@ -254,6 +255,11 @@ int guess_linux_device_type(const char * dev_name) {
strlen(lin_dev_scsi_disk_plus)))
return GUESS_DEVTYPE_SCSI;
// form /dev/scsi/* or scsi/*
if (!strncmp(lin_dev_scsi_devfs_disk_plus, dev_name,
strlen(lin_dev_scsi_devfs_disk_plus)))
return GUESS_DEVTYPE_SCSI;
// form /dev/ns* or ns*
if (!strncmp(lin_dev_scsi_tape1, dev_name,
strlen(lin_dev_scsi_tape1)))
......
......@@ -36,7 +36,7 @@
#include "utility.h"
// Any local header files should be represented by a CVSIDX just below.
const char* utility_c_cvsid="$Id: utility.cpp,v 1.10 2003/05/06 03:24:48 ballen4705 Exp $" UTILITY_H_CVSID;
const char* utility_c_cvsid="$Id: utility.cpp,v 1.11 2003/05/06 22:58:00 guidog Exp $" UTILITY_H_CVSID;
// Utility function prints date and time and timezone into a character
......@@ -216,8 +216,9 @@ int split_report_arg(char *s, int *i)
// osst, nosst and sg.
static const char * lin_dev_prefix = "/dev/";
static const char * lin_dev_ata_disk_plus = "h";
static const char * lin_dev_ata_devfs_disk_plus = "ide/";
static const char * lin_dev_scsi_devfs_disk_plus = "scsi/";
static const char * lin_dev_scsi_disk_plus = "s";
static const char * lin_dev_ide_plus = "i";
static const char * lin_dev_scsi_tape1 = "ns";
static const char * lin_dev_scsi_tape2 = "os";
static const char * lin_dev_scsi_tape3 = "nos";
......@@ -244,9 +245,9 @@ int guess_linux_device_type(const char * dev_name) {
strlen(lin_dev_ata_disk_plus)))
return GUESS_DEVTYPE_ATA;
// form /dev/i* or i*
if (!strncmp(lin_dev_ide_plus, dev_name,
strlen(lin_dev_ide_plus)))
// form /dev/ide/* or ide/*
if (!strncmp(lin_dev_ata_devfs_disk_plus, dev_name,
strlen(lin_dev_ata_devfs_disk_plus)))
return GUESS_DEVTYPE_ATA;
// form /dev/s* or s*
......@@ -254,6 +255,11 @@ int guess_linux_device_type(const char * dev_name) {
strlen(lin_dev_scsi_disk_plus)))
return GUESS_DEVTYPE_SCSI;
// form /dev/scsi/* or scsi/*
if (!strncmp(lin_dev_scsi_devfs_disk_plus, dev_name,
strlen(lin_dev_scsi_devfs_disk_plus)))
return GUESS_DEVTYPE_SCSI;
// form /dev/ns* or ns*
if (!strncmp(lin_dev_scsi_tape1, dev_name,
strlen(lin_dev_scsi_tape1)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment