mirror of
https://github.com/aaru-dps/aaruremote.git
synced 2025-12-16 19:24:37 +00:00
Find device host_no in Linux 2.6.26.
This commit is contained in:
@@ -164,6 +164,7 @@ int32_t GetDeviceType(void* device_ctx)
|
|||||||
char* fc_path;
|
char* fc_path;
|
||||||
char* sas_path;
|
char* sas_path;
|
||||||
int ret;
|
int ret;
|
||||||
|
char delim;
|
||||||
char* chrptr;
|
char* chrptr;
|
||||||
char* sysfs_path_scr;
|
char* sysfs_path_scr;
|
||||||
FILE* file;
|
FILE* file;
|
||||||
@@ -242,11 +243,15 @@ int32_t GetDeviceType(void* device_ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
chrptr = strchr(dev_path, ':');
|
delim = '.';
|
||||||
|
chrptr = strrchr(dev_path, delim);
|
||||||
|
|
||||||
if(!chrptr)
|
if(!chrptr)
|
||||||
{
|
{
|
||||||
chrptr = strrchr(dev_path, '.');
|
delim = ':';
|
||||||
|
chrptr = strrchr(dev_path, delim);
|
||||||
|
}
|
||||||
|
|
||||||
if(!chrptr)
|
if(!chrptr)
|
||||||
{
|
{
|
||||||
free((void*)sysfs_path);
|
free((void*)sysfs_path);
|
||||||
@@ -259,7 +264,6 @@ int32_t GetDeviceType(void* device_ctx)
|
|||||||
free((void*)sas_path);
|
free((void*)sas_path);
|
||||||
return dev_type;
|
return dev_type;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
chrptr--;
|
chrptr--;
|
||||||
|
|
||||||
@@ -270,8 +274,15 @@ int32_t GetDeviceType(void* device_ctx)
|
|||||||
chrptr++;
|
chrptr++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if(chrptr[0] == delim)
|
||||||
|
{
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ret++;
|
ret++;
|
||||||
|
}
|
||||||
|
|
||||||
chrptr--;
|
chrptr--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user