summaryrefslogtreecommitdiff
path: root/ndb/src/cw
diff options
context:
space:
mode:
authorunknown <ndbdev@eel.hemma.oreland.se>2004-08-04 20:48:48 +0200
committerunknown <ndbdev@eel.hemma.oreland.se>2004-08-04 20:48:48 +0200
commit8b45aa646e403935f6a3878f44d6f0e8b3db6c25 (patch)
tree73af6a3cca679628549cd2b58f015265491121cb /ndb/src/cw
parent42009c2f52cb912132b26675b149b1d85083178b (diff)
downloadmariadb-git-8b45aa646e403935f6a3878f44d6f0e8b3db6c25.tar.gz
wl1292 - workaround for mgmsrv node id problems
ndb/src/cw/cpcd/Makefile.am: Put cpcd in libexec ndb/src/cw/cpcd/Process.cpp: Fixed reverse check with ulimit ndb/test/run-test/main.cpp: Restart mgm server aswell on test failure. Removes problems with nodeid
Diffstat (limited to 'ndb/src/cw')
-rw-r--r--ndb/src/cw/cpcd/Makefile.am2
-rw-r--r--ndb/src/cw/cpcd/Process.cpp78
2 files changed, 38 insertions, 42 deletions
diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am
index 6345bae9bbe..1f7b0d88448 100644
--- a/ndb/src/cw/cpcd/Makefile.am
+++ b/ndb/src/cw/cpcd/Makefile.am
@@ -1,5 +1,5 @@
-ndbtools_PROGRAMS = ndb_cpcd
+ndbbin_PROGRAMS = ndb_cpcd
ndb_cpcd_SOURCES = main.cpp CPCD.cpp Process.cpp APIService.cpp Monitor.cpp common.cpp
diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp
index 74426306a88..d99dda2ba0b 100644
--- a/ndb/src/cw/cpcd/Process.cpp
+++ b/ndb/src/cw/cpcd/Process.cpp
@@ -209,49 +209,45 @@ int
set_ulimit(const BaseString & pair){
#ifdef HAVE_GETRLIMIT
errno = 0;
- do {
- Vector<BaseString> list;
- pair.split(list, ":");
- if(list.size() != 2){
- break;
- }
-
- int res;
- rlim_t value = RLIM_INFINITY;
- if(!(list[1].trim() == "unlimited")){
- value = atoi(list[1].c_str());
- }
-
- struct rlimit rlp;
+ Vector<BaseString> list;
+ pair.split(list, ":");
+ if(list.size() != 2){
+ logger.error("Unable to process ulimit: split >%s< list.size()=%d",
+ pair.c_str(), list.size());
+ return -1;
+ }
+
+ int res;
+ rlim_t value = RLIM_INFINITY;
+ if(!(list[1].trim() == "unlimited")){
+ value = atoi(list[1].c_str());
+ }
+
+ struct rlimit rlp;
#define _RLIMIT_FIX(x) { res = getrlimit(x,&rlp); if(!res){ rlp.rlim_cur = value; res = setrlimit(x, &rlp); }}
-
- if(list[0].trim() == "c"){
- _RLIMIT_FIX(RLIMIT_CORE);
- } else if(list[0] == "d"){
- _RLIMIT_FIX(RLIMIT_DATA);
- } else if(list[0] == "f"){
- _RLIMIT_FIX(RLIMIT_FSIZE);
- } else if(list[0] == "n"){
- _RLIMIT_FIX(RLIMIT_NOFILE);
- } else if(list[0] == "s"){
- _RLIMIT_FIX(RLIMIT_STACK);
- } else if(list[0] == "t"){
- _RLIMIT_FIX(RLIMIT_CPU);
- } else {
- errno = EINVAL;
- break;
- }
- if(!res)
- break;
-
- return 0;
- } while(false);
- logger.error("Unable to process ulimit: %s(%s)",
- pair.c_str(), strerror(errno));
- return -1;
-#else
- return 0; // Maybe it's ok anyway...
+
+ if(list[0].trim() == "c"){
+ _RLIMIT_FIX(RLIMIT_CORE);
+ } else if(list[0] == "d"){
+ _RLIMIT_FIX(RLIMIT_DATA);
+ } else if(list[0] == "f"){
+ _RLIMIT_FIX(RLIMIT_FSIZE);
+ } else if(list[0] == "n"){
+ _RLIMIT_FIX(RLIMIT_NOFILE);
+ } else if(list[0] == "s"){
+ _RLIMIT_FIX(RLIMIT_STACK);
+ } else if(list[0] == "t"){
+ _RLIMIT_FIX(RLIMIT_CPU);
+ } else {
+ errno = EINVAL;
+ }
+ if(res){
+ logger.error("Unable to process ulimit: %s res=%d error=%d(%s)",
+ pair.c_str(), res, errno, strerror(errno));
+ return -1;
+ }
#endif
+ return 0;
}
void