hal/hald/linux block_class_device.c, 1.67, 1.68 input_class_device.c,
1.10, 1.11 printer_class_device.c, 1.9, 1.10
David Zeuthen
david at freedesktop.org
Fri Sep 3 10:47:10 PDT 2004
Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv18086/hald/linux
Modified Files:
block_class_device.c input_class_device.c
printer_class_device.c
Log Message:
2004-09-03 David Zeuthen <david at fubar.dk>
Patch from Martin Pitt <martin at piware.de>.
* hald/linux/block_class_device.c: (cdrom_get_properties),
(detect_media):
* hald/linux/input_class_device.c: (input_class_pre_process):
* hald/linux/printer_class_device.c: (printer_class_pre_process):
Intercept unchecked ioctl calls and log failures.
Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- block_class_device.c 31 Aug 2004 16:53:33 -0000 1.67
+++ block_class_device.c 3 Sep 2004 17:47:08 -0000 1.68
@@ -273,7 +273,8 @@
if (fd < 0)
return;
- ioctl (fd, CDROM_SET_OPTIONS, CDO_USE_FFLAGS);
+ if( ioctl (fd, CDROM_SET_OPTIONS, CDO_USE_FFLAGS) < 0 )
+ HAL_ERROR(("CDROM_SET_OPTIONS failed: %s\n", strerror(errno)));
capabilities = ioctl (fd, CDROM_GET_CAPABILITY, 0);
if (capabilities < 0) {
@@ -799,6 +800,10 @@
got_media = TRUE;
break;
+ case -1:
+ HAL_ERROR(("CDROM_DRIVE_STATUS failed: %s\n", strerror(errno)));
+ break;
+
default:
break;
}
Index: input_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/input_class_device.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- input_class_device.c 5 Jul 2004 18:54:58 -0000 1.10
+++ input_class_device.c 3 Sep 2004 17:47:08 -0000 1.11
@@ -38,6 +38,7 @@
#include <limits.h>
#include <fcntl.h>
#include <linux/input.h>
+#include <errno.h>
#include "../logger.h"
#include "../device_store.h"
@@ -135,7 +136,8 @@
if (ioctl(fd, EVIOCGNAME(sizeof name), name) >= 0) {
hal_device_property_set_string (d, "info.product",
name);
- }
+ } else
+ HAL_ERROR(("EVIOCGNAME failed: %s\n", strerror(errno)));
}
/* @todo add more ioctl()'s here */
Index: printer_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/printer_class_device.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- printer_class_device.c 5 Jul 2004 18:21:07 -0000 1.9
+++ printer_class_device.c 3 Sep 2004 17:47:08 -0000 1.10
@@ -41,6 +41,7 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
+#include <errno.h>
#include "../logger.h"
#include "../device_store.h"
@@ -115,7 +116,9 @@
device_id) < 0) {
close (fd);
return;
- }
+ } else
+ HAL_ERROR(("LPIOC_GET_DEVICE_ID failed: %s\n", strerror(errno)));
+
close (fd);
More information about the hal-commit
mailing list