Commit dddda9d6 authored by Rich Prohaska's avatar Rich Prohaska

#137 fix osx build problem

parent f64edcc4
...@@ -67,6 +67,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS) ...@@ -67,6 +67,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
dump-env dump-env
env_loader_memory env_loader_memory
env-put-multiple env-put-multiple
env_nproc
env_startup env_startup
execute-updates execute-updates
filesize filesize
......
...@@ -93,8 +93,7 @@ PATENT RIGHTS GRANT: ...@@ -93,8 +93,7 @@ PATENT RIGHTS GRANT:
#include <db.h> #include <db.h>
#include <sys/resource.h> #include <sys/resource.h>
static int env_open_close(void) { static void env_open_close(void) {
int result = 0;
int r; int r;
DB_ENV *env = NULL; DB_ENV *env = NULL;
...@@ -104,11 +103,9 @@ static int env_open_close(void) { ...@@ -104,11 +103,9 @@ static int env_open_close(void) {
r = env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK+DB_INIT_MPOOL+DB_INIT_TXN+DB_INIT_LOG + DB_CREATE + DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); r = env->open(env, TOKU_TEST_FILENAME, DB_INIT_LOCK+DB_INIT_MPOOL+DB_INIT_TXN+DB_INIT_LOG + DB_CREATE + DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO);
if (r != 0) { if (r != 0) {
fprintf(stderr, "%s:%u r=%d\n", __FILE__, __LINE__, r); fprintf(stderr, "%s:%u r=%d\n", __FILE__, __LINE__, r);
result = r;
} }
r = env->close(env, 0); r = env->close(env, 0);
assert(r == 0); assert(r == 0);
return result;
} }
int test_main (int argc, char * const argv[]) { int test_main (int argc, char * const argv[]) {
...@@ -135,13 +132,12 @@ int test_main (int argc, char * const argv[]) { ...@@ -135,13 +132,12 @@ int test_main (int argc, char * const argv[]) {
struct rlimit nproc_rlimit; struct rlimit nproc_rlimit;
r = getrlimit(RLIMIT_NPROC, &nproc_rlimit); r = getrlimit(RLIMIT_NPROC, &nproc_rlimit);
assert(r == 0); assert(r == 0);
nproc_rlimit.rlim_cur = limit; nproc_rlimit.rlim_cur = limit;
r = setrlimit(RLIMIT_NPROC, &nproc_rlimit); r = setrlimit(RLIMIT_NPROC, &nproc_rlimit);
assert(r == 0); assert(r == 0);
printf("nproc %lu\n", nproc_rlimit.rlim_cur); env_open_close();
(void) env_open_close();
return 0; return 0;
} }
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