From d941d1d77f7b59bca50e70b24dfc0f7970733791 Mon Sep 17 00:00:00 2001 From: dlukes <dlukes@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Fri, 19 Dec 2008 15:49:38 +0000 Subject: [PATCH] Replace hardcoded path with system predefined constant. git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2693 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- sm5/os_freebsd.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sm5/os_freebsd.cpp b/sm5/os_freebsd.cpp index 20a485f2c..cf4118f7d 100644 --- a/sm5/os_freebsd.cpp +++ b/sm5/os_freebsd.cpp @@ -46,9 +46,9 @@ #include "extern.h" #include "os_freebsd.h" -static __unused const char *filenameandversion="$Id: os_freebsd.cpp,v 1.71 2008/12/19 13:36:17 dlukes Exp $"; +static __unused const char *filenameandversion="$Id: os_freebsd.cpp,v 1.72 2008/12/19 15:49:38 dlukes Exp $"; -const char *os_XXXX_c_cvsid="$Id: os_freebsd.cpp,v 1.71 2008/12/19 13:36:17 dlukes Exp $" \ +const char *os_XXXX_c_cvsid="$Id: os_freebsd.cpp,v 1.72 2008/12/19 15:49:38 dlukes Exp $" \ ATACMDS_H_CVSID CCISS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_FREEBSD_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID; extern smartmonctrl * con; @@ -883,6 +883,10 @@ static int get_tw_channel_unit (const char* name, int* unit, int* dev) { } +#ifndef ATA_DEVICE +#define ATA_DEVICE "/dev/ata" +#endif + #ifndef IOCATAREQUEST static int get_ata_channel_unit ( const char* name, int* unit, int* dev) { #ifndef ATAREQUEST @@ -898,7 +902,7 @@ return 0; bzero(&iocmd, sizeof(struct ata_cmd)); - if ((fd = open("/dev/ata", O_RDWR)) < 0) + if ((fd = open(ATA_DEVICE, O_RDWR)) < 0) return -errno; iocmd.cmd = ATAGMAXCHANNEL; @@ -936,7 +940,7 @@ return 0; // Guess device type (ata or scsi) based on device name (FreeBSD // specific) SCSI device name in FreeBSD can be sd, sr, scd, st, nst, // osst, nosst and sg. -static const char * fbsd_dev_prefix = "/dev/"; +static const char * fbsd_dev_prefix = _PATH_DEV; static const char * fbsd_dev_ata_disk_prefix = "ad"; static const char * fbsd_dev_scsi_disk_plus = "da"; static const char * fbsd_dev_scsi_pass = "pass"; @@ -1216,10 +1220,6 @@ end: return(n); } -#ifndef ATA_DEVICE -#define ATA_DEVICE "/dev/ata" -#endif - // we are using ATA subsystem enumerator to found all ATA devices on system // despite of it's names // -- GitLab