Skip to content
Snippets Groups Projects
Commit 3cb638c5 authored by ballen4705's avatar ballen4705
Browse files

Changed access to Read only from Read/Write.

In identify command, if WIN_IDENTITY fails, try WIN_PIDENTITY to get some
info about packet devices.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@71 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent f9d2b4fe
No related branches found
No related tags found
No related merge requests found
CHANGELOG for smartmontools
$Id: CHANGELOG,v 1.9 2002/10/20 19:40:23 ballen4705 Exp $
$Id: CHANGELOG,v 1.10 2002/10/21 08:49:23 ballen4705 Exp $
Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
......@@ -29,6 +29,8 @@ NOTES FOR NEXT RELEASE:
smartmontools-5.0-11
device opened only in read-only not read-write mode. Don't need R/W
access to get smart data.
smartctl now handles all possible choices of "multiple options"
gracefully. It goes through the following phases of operation,
......@@ -37,6 +39,10 @@ smartmontools-5.0-11
operation. Control flow through ataPrintMain()
simplified.
If reading device identity information fails, try seeing if the info
can be accessed using a "DEVICE PACKET" command. This way we can
at least get device info.
Modified Makefile to automatically tag CVS archive on issuance of
a release
......
// $Id: atacmds.c,v 1.10 2002/10/20 19:40:23 ballen4705 Exp $
// $Id: atacmds.c,v 1.11 2002/10/21 08:49:23 ballen4705 Exp $
/*
* atacmds.c
*
......@@ -140,11 +140,13 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){
unsigned char parms[HDIO_DRIVE_CMD_HDR_SIZE+sizeof(*buf)]=
{WIN_IDENTIFY, 0, 0, 1,};
if (ioctl(device ,HDIO_DRIVE_CMD,parms)){
parms[0]=WIN_PIDENTIFY;
if (ioctl(device ,HDIO_DRIVE_CMD,parms)){
perror ("ATA GET HD Identity Failed");
return -1;
}
}
// copy data into driveid structure
memcpy(buf,parms+HDIO_DRIVE_CMD_HDR_SIZE,sizeof(*buf));
......
// $Id: atacmds.cpp,v 1.10 2002/10/20 19:40:23 ballen4705 Exp $
// $Id: atacmds.cpp,v 1.11 2002/10/21 08:49:23 ballen4705 Exp $
/*
* atacmds.c
*
......@@ -140,11 +140,13 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){
unsigned char parms[HDIO_DRIVE_CMD_HDR_SIZE+sizeof(*buf)]=
{WIN_IDENTIFY, 0, 0, 1,};
if (ioctl(device ,HDIO_DRIVE_CMD,parms)){
parms[0]=WIN_PIDENTIFY;
if (ioctl(device ,HDIO_DRIVE_CMD,parms)){
perror ("ATA GET HD Identity Failed");
return -1;
}
}
// copy data into driveid structure
memcpy(buf,parms+HDIO_DRIVE_CMD_HDR_SIZE,sizeof(*buf));
......
// $Id: smartctl.c,v 1.10 2002/10/20 19:22:02 ballen4705 Exp $
// $Id: smartctl.c,v 1.11 2002/10/21 08:49:23 ballen4705 Exp $
/*
* smartctl.c
*
......@@ -229,7 +229,7 @@ int main (int argc, char **argv){
printf("is free software, and you are welcome to redistribute it\n");
printf("under the terms of the GNU General Public License Version 2.\n");
printf("See http://www.gnu.org for further details.\n\n");
printf("CVS version ID %s\n","$Id: smartctl.c,v 1.10 2002/10/20 19:22:02 ballen4705 Exp $");
printf("CVS version ID %s\n","$Id: smartctl.c,v 1.11 2002/10/21 08:49:23 ballen4705 Exp $");
if (argc==2)
exit(0);
}
......@@ -240,8 +240,8 @@ int main (int argc, char **argv){
exit (-1);
}
/* open device */
fd = open ( device=argv[2], O_RDWR );
// open device - read-only mode is enough to issue needed commands
fd = open ( device=argv[2], O_RDONLY );
if ( fd < 0) {
perror ( "Device open failed");
......
// $Id: smartctl.cpp,v 1.10 2002/10/20 19:22:02 ballen4705 Exp $
// $Id: smartctl.cpp,v 1.11 2002/10/21 08:49:23 ballen4705 Exp $
/*
* smartctl.c
*
......@@ -229,7 +229,7 @@ int main (int argc, char **argv){
printf("is free software, and you are welcome to redistribute it\n");
printf("under the terms of the GNU General Public License Version 2.\n");
printf("See http://www.gnu.org for further details.\n\n");
printf("CVS version ID %s\n","$Id: smartctl.cpp,v 1.10 2002/10/20 19:22:02 ballen4705 Exp $");
printf("CVS version ID %s\n","$Id: smartctl.cpp,v 1.11 2002/10/21 08:49:23 ballen4705 Exp $");
if (argc==2)
exit(0);
}
......@@ -240,8 +240,8 @@ int main (int argc, char **argv){
exit (-1);
}
/* open device */
fd = open ( device=argv[2], O_RDWR );
// open device - read-only mode is enough to issue needed commands
fd = open ( device=argv[2], O_RDONLY );
if ( fd < 0) {
perror ( "Device open failed");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment