summaryrefslogtreecommitdiffstats
path: root/lib/libdevinfo/devinfo.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-09-20 02:16:33 +0000
committerimp <imp@FreeBSD.org>2002-09-20 02:16:33 +0000
commita4260bf8f13b36400c592d22d847e493853de5eb (patch)
treebbf4b3adcfce72b29e0bb46bc3df318d2f30042b /lib/libdevinfo/devinfo.c
parentb43e53617ad2515831d7410b70fe9385e5fc2b86 (diff)
downloadFreeBSD-src-a4260bf8f13b36400c592d22d847e493853de5eb.zip
FreeBSD-src-a4260bf8f13b36400c592d22d847e493853de5eb.tar.gz
Expose the new kernel data structures to libdevinfo:
o Added dd_pnpinfo, dd_location, dd_devflags, dd_flags and dd_state o Copy/initialize these as necessary. o Document the changes to the interface in devinfo.3.
Diffstat (limited to 'lib/libdevinfo/devinfo.c')
-rw-r--r--lib/libdevinfo/devinfo.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/libdevinfo/devinfo.c b/lib/libdevinfo/devinfo.c
index 650b7f8..0318629 100644
--- a/lib/libdevinfo/devinfo.c
+++ b/lib/libdevinfo/devinfo.c
@@ -218,13 +218,22 @@ devinfo_init_devices(int generation)
return(ENOMEM);
dd->dd_dev.dd_handle = udev.dv_handle;
dd->dd_dev.dd_parent = udev.dv_parent;
- snprintf(dd->dd_name, DEVINFO_STRLEN, "%s", udev.dv_name);
+ snprintf(dd->dd_name, sizeof(dd->dd_name), "%s", udev.dv_name);
dd->dd_dev.dd_name = &dd->dd_name[0];
- snprintf(dd->dd_desc, DEVINFO_STRLEN, "%s", udev.dv_desc);
+ snprintf(dd->dd_desc, sizeof(dd->dd_desc), "%s", udev.dv_desc);
dd->dd_dev.dd_desc = &dd->dd_desc[0];
- snprintf(dd->dd_drivername, DEVINFO_STRLEN, "%s",
+ snprintf(dd->dd_drivername, sizeof(dd->dd_drivername), "%s",
udev.dv_drivername);
dd->dd_dev.dd_drivername = &dd->dd_drivername[0];
+ snprintf(dd->dd_pnpinfo, sizeof(dd->dd_pnpinfo), "%s",
+ udev.dv_pnpinfo);
+ dd->dd_dev.dd_pnpinfo = &dd->dd_pnpinfo[0];
+ snprintf(dd->dd_location, sizeof(dd->dd_location), "%s",
+ udev.dv_location);
+ dd->dd_dev.dd_location = &dd->dd_location[0];
+ dd->dd_dev.dd_devflags = udev.dv_devflags;
+ dd->dd_dev.dd_flags = udev.dv_flags;
+ dd->dd_dev.dd_state = udev.dv_state;
TAILQ_INSERT_TAIL(&devinfo_dev, dd, dd_link);
}
debug("fetched %d devices", dev_idx);
OpenPOWER on IntegriCloud