Changeset View
Changeset View
Standalone View
Standalone View
stand/ofw/libofw/devicename.c
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | found: | ||||
if (path != NULL) | if (path != NULL) | ||||
*path = s; | *path = s; | ||||
idev = malloc(sizeof(struct ofw_devdesc)); | idev = malloc(sizeof(struct ofw_devdesc)); | ||||
if (idev == NULL) { | if (idev == NULL) { | ||||
printf("ofw_parsedev: malloc failed\n"); | printf("ofw_parsedev: malloc failed\n"); | ||||
return ENOMEM; | return ENOMEM; | ||||
} | } | ||||
strcpy(idev->d_path, name); | strcpy(idev->d_path, name); | ||||
idev->d_dev = dv; | idev->dd.d_dev = dv; | ||||
idev->d_type = dv->dv_type; | if (dv->dv_type == DEVT_ZFS) { | ||||
if (idev->d_type == DEVT_ZFS) { | |||||
p = devspec + strlen(dv->dv_name); | p = devspec + strlen(dv->dv_name); | ||||
err = zfs_parsedev((struct zfs_devdesc *)idev, p, path); | err = zfs_parsedev((struct zfs_devdesc *)idev, p, path); | ||||
if (err != 0) { | if (err != 0) { | ||||
free(idev); | free(idev); | ||||
return (err); | return (err); | ||||
} | } | ||||
} | } | ||||
Show All 21 Lines |