static int open_existing(const char * const path, pentry_t *pe, int flags) { int ret; int fd; /* get the fd of the file we want to read */ fd = pentry_get_fd(pe); /* negative fd? then we don't have any cache file, get it! */ if (fd < 0) { (void)build_cache_tree(path); fd = dfs_get_local_copy(pe, path, flags); if (-1 == fd) { ret = -1; goto err; } pentry_set_fd(pe, fd); } ret = 0; err: return ret; }
static int open_existing(const char * const path, tpath_entry *pe, int flags) { int ret; /* negative fd? then we don't have any cache file, get it! */ if (pe->fd < 0) { (void) build_cache_tree(path); pe->fd = dfs_get_local_copy(pe, path, flags); if (-1 == pe->fd) { ret = -1; goto err; } } ret = 0; err: return ret; }