Commit 94d5dcd4 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

merge 1032 into 1032b. addresses #1032

git-svn-id: file:///svn/toku/tokudb.1032b@7787 c7de825b-a66e-492c-adef-691d508d4ae1
parent f41b1eab
......@@ -192,13 +192,12 @@ static void cachefile_init_filenum(CACHEFILE newcf, int fd, const char *fname, s
int toku_cachetable_openfd (CACHEFILE *cf, CACHETABLE t, int fd, const char *fname) {
int r;
CACHEFILE extant;
struct stat statbuf;
struct fileid fileid;
memset(&fileid, 0, sizeof(fileid));
r=fstat(fd, &statbuf);
if (r != 0) { r=errno; close(fd); }
fileid.st_dev = statbuf.st_dev;
fileid.st_ino = statbuf.st_ino;
r = os_get_unique_file_id(fd, &fileid);
if (r != 0) {
r=errno; close(fd);
return r;
}
for (extant = t->cachefiles; extant; extant=extant->next) {
if (memcmp(&extant->fileid, &fileid, sizeof(fileid))==0) {
r = close(fd);
......
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