equal
deleted
inserted
replaced
173 |
173 |
174 // open the cache object for this image |
174 // open the cache object for this image |
175 if (pt_cache_open(&image->cache, cache_path, cache_mode)) |
175 if (pt_cache_open(&image->cache, cache_path, cache_mode)) |
176 goto error; |
176 goto error; |
177 |
177 |
178 // update if not fresh |
178 // compare cache with image |
179 // XXX: check cache_mode |
179 // XXX: check cache_mode |
180 if ((stale = pt_cache_stale(image->cache, image->path)) < 0) |
180 if ((stale = pt_cache_stale(image->cache, image->path)) < 0) |
181 goto error; |
181 goto error; |
182 |
182 |
183 if (stale) |
183 // update if not fresh |
184 pt_image_update_cache(image); |
184 if (stale) { |
185 |
185 if (pt_image_update_cache(image)) |
|
186 goto error; |
|
187 } |
|
188 |
186 // ok, ready for access |
189 // ok, ready for access |
187 *image_ptr = image; |
190 *image_ptr = image; |
188 |
191 |
189 return 0; |
192 return 0; |
190 |
193 |