diff options
| author | Warner Losh <imp@FreeBSD.org> | 2018-05-30 15:08:59 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2018-05-30 15:08:59 +0000 |
| commit | b98d2b35dff9bff4380986818b0c6d93a751752c (patch) | |
| tree | c3a3f734291aa3453d68f89aa0d9be47a8cc0ec1 /usr.sbin/devinfo | |
| parent | 51a9cfbf605baa9c7a63dd9b999b3e86889cf6c6 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/devinfo')
| -rw-r--r-- | usr.sbin/devinfo/devinfo.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c index c4ec2eeccfd02..be18c57dc5e76 100644 --- a/usr.sbin/devinfo/devinfo.c +++ b/usr.sbin/devinfo/devinfo.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <err.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -242,7 +243,7 @@ int main(int argc, char *argv[]) { struct devinfo_dev *root; - int c, uflag; + int c, uflag, rv; char *path = NULL; uflag = 0; @@ -268,8 +269,10 @@ main(int argc, char *argv[]) if (path && (rflag || uflag)) usage(); - if (devinfo_init()) + if ((rv = devinfo_init()) != 0) { + errno = rv; err(1, "devinfo_init"); + } if ((root = devinfo_handle_to_device(DEVINFO_ROOT_DEVICE)) == NULL) errx(1, "can't find root device"); |
