+ else if (strcasecmp (key, "socket") == 0)
+ return ((socket = strdup (value)) == NULL ? 1 : 0);
+ else if (strcasecmp (key, "port") == 0)
+ {
+ char *endptr = NULL;
+ int temp;
+
+ errno = 0;
+ temp = strtol (value, &endptr, 0);
+ if ((errno != 0) || (value == endptr))
+ {
+ ERROR ("mysql plugin: Invalid \"Port\" argument: %s",
+ value);
+ port = 0;
+ return (1);
+ }
+ else if ((temp < 0) || (temp >= 65535))
+ {
+ ERROR ("mysql plugin: Port number out of range: %i",
+ temp);
+ port = 0;
+ return (1);
+ }
+
+ port = temp;
+ return (0);
+ }