Properly get driver, netname for resource4
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
parent
dca27e07df
commit
3173f19cd6
|
@ -599,12 +599,22 @@ static fm_status GetUioDevInfo(fm_int num, fm_uioDriverInfo *info)
|
|||
static fm_status GetResource4DriverName(fm_text path, fm_char *name)
|
||||
{
|
||||
fm_char filename[FM_UIO_MAX_NAME_SIZE];
|
||||
fm_char buf[FM_UIO_MAX_NAME_SIZE];
|
||||
fm_uint idx;
|
||||
|
||||
FM_SNPRINTF_S(filename, sizeof(filename), "%s/driver", path);
|
||||
|
||||
fm_char buf[FM_UIO_MAX_NAME_SIZE];
|
||||
if(readlink(filename, name, FM_UIO_MAX_NAME_SIZE - 1))
|
||||
name[0] = '\0';
|
||||
if(readlink(filename, buf, FM_UIO_MAX_NAME_SIZE - 1))
|
||||
{
|
||||
for (idx = strlen(buf) - 1; idx > 0; --idx)
|
||||
{
|
||||
if (buf[idx] == '/')
|
||||
{
|
||||
strcpy(name, &buf[idx + 1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FM_OK;
|
||||
}
|
||||
|
||||
|
@ -1971,7 +1981,7 @@ fm_status fmPlatformHostDrvOpen(fm_int sw,
|
|||
|
||||
if ( (netDevName == NULL) && (strcmp(pktIface, "pti") != 0) )
|
||||
{
|
||||
err = GetNetDevFromResource4(resource4DevName,
|
||||
err = GetNetDevFromResource4(startResource4Name,
|
||||
localNetDevName,
|
||||
FM_NETDEV_MAX_NAME_SIZE);
|
||||
if (err != FM_OK)
|
||||
|
|
Loading…
Reference in a new issue