From: Florian Forster Date: Tue, 11 Aug 2009 11:24:04 +0000 (+0200) Subject: madwifi plugin: Rename the ‘DisableSysfs’ to ‘Source’. X-Git-Tag: collectd-4.8.0~54 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a49f20142a5fb2a2dab23bb81195175ac4a48de6;p=collectd.git madwifi plugin: Rename the ‘DisableSysfs’ to ‘Source’. Configurations like DisableSysfs false are confusing. --- diff --git a/src/madwifi.c b/src/madwifi.c index 478341ea..364dcbd7 100644 --- a/src/madwifi.c +++ b/src/madwifi.c @@ -78,13 +78,13 @@ * * * By default, madwifi plugin enumerates network interfaces using /sys - * filesystem. Configuration option DisableSysfs can change this to use + * filesystem. Configuration option `Source' can change this to use * /proc filesystem (which is useful for example when running on Linux * 2.4). But without /sys filesystem, Madwifi plugin cannot check whether * given interface is madwifi interface and there are private ioctls used, * which may do something completely different on non-madwifi devices. - * Therefore, option DisableSysfs should be used together with option - * Interface, to limit found interfaces to madwifi interfaces only. + * Therefore, the /proc filesystem should always be used together with option + * `Interface', to limit found interfaces to madwifi interfaces only. **/ @@ -350,7 +350,7 @@ static const char *config_keys[] = { "Interface", "IgnoreSelected", - "DisableSysfs", + "Source", "WatchAdd", "WatchRemove", "WatchSet", @@ -461,8 +461,20 @@ static int madwifi_config (const char *key, const char *value) else if (strcasecmp (key, "IgnoreSelected") == 0) ignorelist_set_invert (ignorelist, ! bool_arg(value)); - else if (strcasecmp (key, "DisableSysfs") == 0) - use_sysfs = ! bool_arg(value); + else if (strcasecmp (key, "Source") == 0) + { + if (strcasecmp (value, "ProcFS") == 0) + use_sysfs = 0; + else if (strcasecmp (value, "SysFS") == 0) + use_sysfs = 1; + else + { + ERROR ("madwifi plugin: The argument of the `Source' " + "option must either be `SysFS' or " + "`ProcFS'."); + return -1; + } + } else if (strcasecmp (key, "WatchSet") == 0) {