Changeset 3261

Show
Ignore:
Timestamp:
02/25/06 22:32:26 (7 years ago)
Author:
khali
Message:

Fix device scan when no i2c support exists or no i2c bus driver
is loaded.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/lib/sysfs.c

    r3224 r3261  
    2323#include <string.h> 
    2424#include <limits.h> 
     25#include <errno.h> 
    2526#include <sysfs/libsysfs.h> 
    2627#include "data.h" 
     
    172173 
    173174        if (!(cls = sysfs_open_class("i2c-adapter"))) { 
    174                 ret = -SENSORS_ERR_PROC; 
     175                if (errno && errno != ENOENT) 
     176                        ret = -SENSORS_ERR_PROC; 
    175177                goto exit0; 
    176178        } 
    177179 
    178180        if (!(clsdevs = sysfs_get_class_devices(cls))) { 
    179                 ret = -SENSORS_ERR_PROC; 
     181                if (errno) 
     182                        ret = -SENSORS_ERR_PROC; 
    180183                goto exit1; 
    181184        }