Changeset 4895

Show
Ignore:
Timestamp:
09/29/07 13:57:37 (7 years ago)
Author:
khali
Message:

libsensors: Notify the caller when writing a value fails.

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

    r4894 r4895  
    44SVN 
    55  Makefile: Add sensors-conf-convert to make install 
     6  libsensors: Notify the caller when writing a value fails 
    67  sensord: Log the error code on failure 
    78  sensors: Fix spurious critical temperature alarm 
  • lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c

    r4879 r4895  
    578578        snprintf(n, NAME_MAX, "%s/%s", name->path, subfeature->name); 
    579579        if ((f = fopen(n, "w"))) { 
     580                int res; 
    580581                value *= get_type_scaling(subfeature->type); 
    581                 fprintf(f, "%d", (int) value); 
    582                 fclose(f); 
     582                res = fprintf(f, "%d", (int) value); 
     583                if (fclose(f) || res < 0) 
     584                        return -SENSORS_ERR_ACCESS_W; 
    583585        } else 
    584586                return -SENSORS_ERR_KERNEL;