Commit d809fcc3 authored by Alexey Yurchenko's avatar Alexey Yurchenko Committed by Nirbhay Choubey

This commit fixes

  - errno handling in wsp::env::append() method, where error could be returned by mistake
  - return code of sst_prepare_other() when pthread_create() fails - it was returning positive error code which by convention is treated as success.
parent 1b1410c4
/* Copyright 2008-2012 Codership Oy <http://www.codership.com> /* Copyright 2008-2015 Codership Oy <http://www.codership.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -485,7 +485,7 @@ static ssize_t sst_prepare_other (const char* method, ...@@ -485,7 +485,7 @@ static ssize_t sst_prepare_other (const char* method,
{ {
WSREP_ERROR("sst_prepare_other(): pthread_create() failed: %d (%s)", WSREP_ERROR("sst_prepare_other(): pthread_create() failed: %d (%s)",
ret, strerror(ret)); ret, strerror(ret));
return ret; return -ret;
} }
mysql_cond_wait (&arg.cond, &arg.lock); mysql_cond_wait (&arg.cond, &arg.lock);
......
/* Copyright 2010 Codership Oy <http://www.codership.com> /* Copyright 2010-2015 Codership Oy <http://www.codership.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -165,10 +165,9 @@ env::append(const char* val) ...@@ -165,10 +165,9 @@ env::append(const char* val)
++len_; ++len_;
env_[len_] = NULL; env_[len_] = NULL;
} }
else errno_ = errno;
} }
else errno_ = errno;
/* if either realloc() or strdup() failed, errno had been set */
errno_ = errno;
return errno_; return errno_;
} }
......
/* Copyright (C) 2013 Codership Oy <info@codership.com> /* Copyright (C) 2013-2015 Codership Oy <info@codership.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment