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* sas_path;
|
||||
int ret;
|
||||
char delim;
|
||||
char* chrptr;
|
||||
char* sysfs_path_scr;
|
||||
FILE* file;
|
||||
@@ -242,11 +243,15 @@ int32_t GetDeviceType(void* device_ctx)
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
chrptr = strchr(dev_path, ':');
|
||||
delim = '.';
|
||||
chrptr = strrchr(dev_path, delim);
|
||||
|
||||
if(!chrptr)
|
||||
{
|
||||
chrptr = strrchr(dev_path, '.');
|
||||
delim = ':';
|
||||
chrptr = strrchr(dev_path, delim);
|
||||
}
|
||||
|
||||
if(!chrptr)
|
||||
{
|
||||
free((void*)sysfs_path);
|
||||
@@ -259,7 +264,6 @@ int32_t GetDeviceType(void* device_ctx)
|
||||
free((void*)sas_path);
|
||||
return dev_type;
|
||||
}
|
||||
}
|
||||
|
||||
chrptr--;
|
||||
|
||||
@@ -270,8 +274,15 @@ int32_t GetDeviceType(void* device_ctx)
|
||||
chrptr++;
|
||||
break;
|
||||
}
|
||||
|
||||
else if(chrptr[0] == delim)
|
||||
{
|
||||
ret = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret++;
|
||||
}
|
||||
|
||||
chrptr--;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user