diff options
author | David Hows <howsdav@gmail.com> | 2015-05-13 09:49:20 +1000 |
---|---|---|
committer | David Hows <howsdav@gmail.com> | 2015-05-13 09:49:20 +1000 |
commit | 38a7aa843da6b5f9b867ed26d3302dec85d3da5b (patch) | |
tree | 46a21f9b413c8f43db938097040b6facb7eba978 /test/utility | |
parent | 6ed1be8a3ae3fef00c6e38e20117c98da3986b87 (diff) | |
download | mongo-38a7aa843da6b5f9b867ed26d3302dec85d3da5b.tar.gz |
More CR Cleanup
Diffstat (limited to 'test/utility')
-rw-r--r-- | test/utility/test_util.i | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/test/utility/test_util.i b/test/utility/test_util.i index 841eb47168d..ad4dce28010 100644 --- a/test/utility/test_util.i +++ b/test/utility/test_util.i @@ -28,8 +28,6 @@ #include <string.h> #include <stdlib.h> #include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> #include <wiredtiger.h> #include "wt_internal.h" /* For __wt_XXX */ @@ -102,7 +100,7 @@ static inline void testutil_clean_work_dir(char *dir) { size_t inputSize; - int ret, existp; + int exist, ret; char *buffer; /* Additional bytes for the Windows rd command. */ @@ -112,14 +110,13 @@ testutil_clean_work_dir(char *dir) snprintf(buffer, inputSize, "%s%s", RM_COMMAND, dir); - existp = 0; - if ( __wt_exist(NULL, dir, &existp) != 0 ) - testutil_die(existp, - "Unable to check if directory exists"); - if (existp == 1) - if ((ret = system(buffer)) != 0) - testutil_die(ret, - "System call to remove directory failed"); + exist = 0; + if ((ret = __wt_exist(NULL, dir, &exist)) != 0) + testutil_die(ret, + "Unable to check if directory exists"); + if (exist == 1 && (ret = system(buffer)) != 0) + testutil_die(ret, + "System call to remove directory failed"); free(buffer); } |