- free (config.host);
- config.host = sstrdup (value);
- }
- else if (strcasecmp (key, "Port") == 0)
- {
- free (config.port);
- config.port = sstrdup (value);
- }
- else if (strcasecmp (key, "Timeout") == 0)
- {
- config.timeout = (int) (strtod(value, &endptr) * 1000);
- }
- else if (strcasecmp (key, "Pause") == 0)
- {
- config.pause = (int) (strtod (value, &endptr));
+ oconfig_item_t *child = ci->children + i;
+
+ if (strcasecmp ("Host", child->key) == 0)
+ cf_util_get_string (child, &config.host);
+ else if (strcasecmp ("Port", child->key) == 0)
+ cf_util_get_string (child, &config.port);
+ else if (strcasecmp ("Timeout", child->key) == 0)
+ cf_util_get_cdtime (child, &config.timeout);
+ else if (strcasecmp ("Pause", child->key) == 0)
+ cf_util_get_cdtime (child, &config.pause);
+ else
+ WARNING ("gps plugin: Ignoring unknown config option \"%s\".", child->key);