summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2016-01-26 16:33:06 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2016-01-26 16:37:00 +0200
commitfe87829c92f6ce8558e5e32e896d027f0d2ce060 (patch)
tree3055174d7a7852ead791ef010e11d63df8096f88
parente7a89b46d4ece1351cc60d8bafb8bf90ca9d8cc8 (diff)
downloadmariadb-git-fe87829c92f6ce8558e5e32e896d027f0d2ce060.tar.gz
[MDEV-9468]: Client hangs in my_addr_resolvebb-10.1-mdev-9468
Account for timeout of select returning a 0 error code.
-rw-r--r--mysys/my_addr_resolve.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c
index 0b1c60c4131..72b04119855 100644
--- a/mysys/my_addr_resolve.c
+++ b/mysys/my_addr_resolve.c
@@ -175,6 +175,10 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
sizeof(output) - total_bytes_read);
if (extra_bytes_read < 0)
return 1;
+ /* Timeout or max bytes read. */
+ if (extra_bytes_read == 0)
+ break;
+
total_bytes_read += extra_bytes_read;
}
@@ -183,7 +187,7 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
return 1;
/* Go through the addr2line response and get the required data.
- The response is structured in 2 lnes. The first line contains the function
+ The response is structured in 2 lines. The first line contains the function
name, while the second one contains <filename>:<line number> */
for (i = 0; i < total_bytes_read; i++) {
if (output[i] == '\n') {