Changeset 4693

Show
Ignore:
Timestamp:
08/22/07 19:04:12 (7 years ago)
Author:
khali
Message:

Drop support for reloading the configuration with sensors_init().
Instead, the application will have to call sensors_exit() explicitly
before calling sensors_init() again. Most applications don't offer
any way to reload the configuration file, so better optimize for the
initial load.

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

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/lib/init.c

    r4673 r4693  
    4141{ 
    4242  int res; 
    43   sensors_cleanup(); 
     43 
    4444  if (!sensors_init_sysfs()) 
    4545    return -SENSORS_ERR_PROC; 
  • lm-sensors/branches/lm-sensors-3.0.0/lib/libsensors.3

    r4666 r4693  
    5454.B int sensors_init(FILE *input); 
    5555.br 
    56 (Re)load the configuration file and the detected chips list. If this returns a value unequal to zero, you are in trouble; you can not assume anything will be initialized properly. 
     56Load the configuration file and the detected chips list. If this returns a 
     57value unequal to zero, you are in trouble; you can not assume anything will 
     58be initialized properly. If you want to reload the configuration file, call 
     59sensors_cleanup() below before calling sensors_init() again. 
    5760 
    5861.B void sensors_cleanup(void); 
  • lm-sensors/branches/lm-sensors-3.0.0/lib/sensors.h

    r4689 r4693  
    5757} sensors_chip_name; 
    5858 
    59 /* (Re)load the configuration file and the detected chips list. If this 
    60     returns a value unequal to zero, you are in trouble; you can not 
    61     assume anything will be initialized properly. */ 
     59/* Load the configuration file and the detected chips list. If this 
     60   returns a value unequal to zero, you are in trouble; you can not 
     61   assume anything will be initialized properly. If you want to 
     62   reload the configuration file, call sensors_cleanup() below before 
     63   calling sensors_init() again. */ 
    6264int sensors_init(FILE *input); 
    6365 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/lib.c

    r2832 r4693  
    9191    ret = 10; 
    9292  } else if (!reload || (difftime (stats.st_mtime, cfgLastModified) > 0.0)) { 
    93     if (reload) 
     93    if (reload) { 
    9494      sensorLog (LOG_INFO, "configuration reloading"); 
     95      sensors_cleanup (); 
     96    } 
    9597    if (!(cfg = fopen (cfgPath, "r"))) { 
    9698      sensorLog (LOG_ERR, "Error opening sensors configuration file: %s", cfgPath);