display errors

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17663 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2006-05-31 00:04:24 +00:00
parent 84aae13f6d
commit 0e6b0daca9

View File

@ -73,14 +73,18 @@ static void dump_geom(int dev, bool bios)
puts(""); puts("");
} }
static void dump_other(int dev) static void dump_misc(int dev)
{ {
char path[B_PATH_NAME_LENGTH]; 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); printf("driver:\t%s\n", path);
} }
#ifdef __HAIKU__ #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); printf("device path:\t%s\n", path);
} }
#endif #endif
@ -104,6 +108,6 @@ int main(int argc, char **argv)
dump_media_status(dev); dump_media_status(dev);
dump_geom(dev, false); dump_geom(dev, false);
dump_geom(dev, true); dump_geom(dev, true);
dump_other(dev); dump_misc(dev);
return 0; return 0;
} }