Changeset 4896

Show
Ignore:
Timestamp:
09/29/07 14:46:36 (7 years ago)
Author:
khali
Message:

libsensors: Differentiate between different read error types.

Location:
lm-sensors/branches/lm-sensors-3.0.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/CHANGES

    r4895 r4896  
    55  Makefile: Add sensors-conf-convert to make install 
    66  libsensors: Notify the caller when writing a value fails 
     7              Differentiate between different read error types 
    78  sensord: Log the error code on failure 
    89  sensors: Fix spurious critical temperature alarm 
  • lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c

    r4895 r4896  
    559559        if ((f = fopen(n, "r"))) { 
    560560                int res = fscanf(f, "%lf", value); 
    561                 fclose(f); 
    562                 if (res != 1) 
    563                         return -SENSORS_ERR_KERNEL; 
     561                if (fclose(f) || res != 1) 
     562                        return -SENSORS_ERR_ACCESS_R; 
    564563                *value /= get_type_scaling(subfeature->type); 
    565564        } else