Commit 97e2e3ba authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Fix up error handling in tokulogger_create_and_open_logger

git-svn-id: file:///svn/tokudb@700 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5784ee45
...@@ -18,9 +18,9 @@ int tokulogger_find_next_unused_log_file(const char *directory, long long *resul ...@@ -18,9 +18,9 @@ int tokulogger_find_next_unused_log_file(const char *directory, long long *resul
DIR *d=opendir(directory); DIR *d=opendir(directory);
long long max=-1; long long max=-1;
struct dirent *de; struct dirent *de;
if (d==0) return *result = errno; if (d==0) return errno;
while ((de=readdir(d))) { while ((de=readdir(d))) {
if (de==0) return *result = -errno; if (de==0) return errno;
long long thisl; long long thisl;
int r = sscanf(de->d_name, "log%llu.tokulog", &thisl); int r = sscanf(de->d_name, "log%llu.tokulog", &thisl);
if (r==1 && thisl>max) max=thisl; if (r==1 && thisl>max) max=thisl;
...@@ -39,7 +39,7 @@ int tokulogger_create_and_open_logger (const char *directory, TOKULOGGER *result ...@@ -39,7 +39,7 @@ int tokulogger_create_and_open_logger (const char *directory, TOKULOGGER *result
if (r!=0) { if (r!=0) {
died0: died0:
toku_free(result); toku_free(result);
return nexti; return r;
} }
result->directory = toku_strdup(directory); result->directory = toku_strdup(directory);
if (result->directory==0) goto died0; if (result->directory==0) goto died0;
......
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