MXS-1220: Fix minor problems with admin thread

The admin thread now uses blocking IO. This is not optimal but it
simplifies the code by some amount.

Fixed option processing removing one extra character from key name.

Use correct member variable when checking for the option map end.
This commit is contained in:
Markus Mäkelä
2017-04-17 13:46:40 +03:00
committed by Markus Mäkelä
parent c4a8f8c8a6
commit caf2172677
5 changed files with 35 additions and 10 deletions

View File

@ -122,6 +122,29 @@ int setnonblocking(int fd)
return 0;
}
int setblocking(int fd)
{
int fl;
if ((fl = fcntl(fd, F_GETFL, 0)) == -1)
{
MXS_ERROR("Can't GET fcntl for %i, errno = %d, %s.",
fd,
errno,
mxs_strerror(errno));
return 1;
}
if (fcntl(fd, F_SETFL, fl & ~O_NONBLOCK) == -1)
{
MXS_ERROR("Can't SET fcntl for %i, errno = %d, %s",
fd,
errno,
mxs_strerror(errno));
return 1;
}
return 0;
}
char *gw_strend(register const char *s)
{