CBL-Mariner/SPECS-EXTENDED/sblim-cmpi-sysfs/sblim-cmpi-sysfs-1.2.0-prov...

13 строки
833 B
Diff

diff -up sblim-cmpi-sysfs-1.2.0/util/Linux_SysfsAttributeUtil.c.orig sblim-cmpi-sysfs-1.2.0/util/Linux_SysfsAttributeUtil.c
--- sblim-cmpi-sysfs-1.2.0/util/Linux_SysfsAttributeUtil.c.orig 2011-11-03 13:24:11.722220576 +0100
+++ sblim-cmpi-sysfs-1.2.0/util/Linux_SysfsAttributeUtil.c 2011-11-03 13:24:46.621218152 +0100
@@ -123,7 +123,7 @@ CMPIInstance * Linux_SysfsAttributeUtil
}
/* Read the instance value from the instance file */
- if ( (fileinfo.st_mode & S_IRUSR) && (instancefile = fopen(instancename,"r")) != NULL) {
+ if ( (fileinfo.st_mode & S_IRUSR) && (fileinfo.st_size > 0) && (instancefile = fopen(instancename,"r")) != NULL) {
/* Read in each of the whitespace separated values from the file */
fscanf(instancefile, " %s", buffer);
while (fscanf(instancefile, " %s", val) != EOF) {