[PATCH] libsensors error reports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

It seems that libsensors is reporting errors in cases where there are no
errors, but simply no sensors were found. This was reported by several
confused users in the past few months. I think we should fix this.
Proposed patch below, comments welcome. Mark, is this OK with you?

Index: lib/sysfs.c
===================================================================
--- lib/sysfs.c	(revision 4036)
+++ lib/sysfs.c	(working copy)
@@ -112,7 +112,8 @@
 	}
 
 	if (!(devs = sysfs_get_bus_devices(bus))) {
-		ret = -SENSORS_ERR_PROC;
+		if (errno)
+			ret = -SENSORS_ERR_PROC;
 		goto exit1;
 	}
 
@@ -142,7 +143,8 @@
 	}
 
 	if (!(clsdevs = sysfs_get_class_devices(cls))) {
-		ret = -SENSORS_ERR_PROC;
+		if (errno)
+			ret = -SENSORS_ERR_PROC;
 		goto exit;
 	}
 

-- 
Jean Delvare




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux