From 0e6b0daca98d3ecc270f3c22a426dfb5e4f9cc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Wed, 31 May 2006 00:04:24 +0000 Subject: [PATCH] display errors git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17663 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/driveinfo.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bin/driveinfo.c b/src/bin/driveinfo.c index 048465f4a0..c2a96d27e2 100644 --- a/src/bin/driveinfo.c +++ b/src/bin/driveinfo.c @@ -73,14 +73,18 @@ static void dump_geom(int dev, bool bios) puts(""); } -static void dump_other(int dev) +static void dump_misc(int dev) { char path[B_PATH_NAME_LENGTH]; - if (ioctl(dev, B_GET_DRIVER_FOR_DEVICE, path, sizeof(path)) >= 0) { + if (ioctl(dev, B_GET_DRIVER_FOR_DEVICE, path, sizeof(path)) < 0) { + perror("ioctl(B_GET_DRIVER_FOR_DEVICE)"); + } else { printf("driver:\t%s\n", path); } #ifdef __HAIKU__ - if (ioctl(dev, B_GET_PATH_FOR_DEVICE, path, sizeof(path)) >= 0) { + if (ioctl(dev, B_GET_PATH_FOR_DEVICE, path, sizeof(path)) < 0) { + perror("ioctl(B_GET_PATH_FOR_DEVICE)"); + } else { printf("device path:\t%s\n", path); } #endif @@ -104,6 +108,6 @@ int main(int argc, char **argv) dump_media_status(dev); dump_geom(dev, false); dump_geom(dev, true); - dump_other(dev); + dump_misc(dev); return 0; }