diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-11-19 21:48:08 -0200 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-11-19 21:48:08 -0200 |
commit | 5aeeaaf507ac87f6ff56806fe8a356cea7d4a48f (patch) | |
tree | d21225ac09b301f317ca89093128769a5ede9fbb /vio/vio.c | |
parent | 780871d8b90fe3146db39b4be65ebedb309b9f9b (diff) | |
parent | 5128b54c38ae183d18a29e00b318c22046445715 (diff) | |
download | mariadb-git-5aeeaaf507ac87f6ff56806fe8a356cea7d4a48f.tar.gz |
Manual merge of mysql-next-mr-runtime upstream.
Diffstat (limited to 'vio/vio.c')
-rw-r--r-- | vio/vio.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vio/vio.c b/vio/vio.c index fd8e2e5a402..34e02adae3d 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -22,6 +22,28 @@ #include "vio_priv.h" +#if defined(__WIN__) || defined(HAVE_SMEM) + +/** + Stub poll_read method that defaults to indicate that there + is data to read. + + Used for named pipe and shared memory VIO types. + + @param vio Unused. + @param timeout Unused. + + @retval FALSE There is data to read. +*/ + +static my_bool no_poll_read(Vio *vio __attribute__((unused)), + uint timeout __attribute__((unused))) +{ + return FALSE; +} + +#endif + /* * Helper to fill most of the Vio* with defaults. */ @@ -60,6 +82,9 @@ static void vio_init(Vio* vio, enum enum_vio_type type, vio->vioblocking =vio_blocking; vio->is_blocking =vio_is_blocking; + vio->poll_read =no_poll_read; + vio->is_connected =vio_is_connected_pipe; + vio->timeout=vio_win32_timeout; /* Set default timeout */ vio->read_timeout_millis = INFINITE; @@ -87,6 +112,9 @@ static void vio_init(Vio* vio, enum enum_vio_type type, vio->vioblocking =vio_blocking; vio->is_blocking =vio_is_blocking; + vio->poll_read =no_poll_read; + vio->is_connected =vio_is_connected_shared_memory; + /* Currently, shared memory is on Windows only, hence the below is ok*/ vio->timeout= vio_win32_timeout; /* Set default timeout */ @@ -112,6 +140,8 @@ static void vio_init(Vio* vio, enum enum_vio_type type, vio->vioblocking =vio_ssl_blocking; vio->is_blocking =vio_is_blocking; vio->timeout =vio_timeout; + vio->poll_read =vio_poll_read; + vio->is_connected =vio_is_connected; DBUG_VOID_RETURN; } #endif /* HAVE_OPENSSL */ @@ -130,6 +160,8 @@ static void vio_init(Vio* vio, enum enum_vio_type type, vio->vioblocking =vio_blocking; vio->is_blocking =vio_is_blocking; vio->timeout =vio_timeout; + vio->poll_read =vio_poll_read; + vio->is_connected =vio_is_connected; } DBUG_VOID_RETURN; } |