summaryrefslogtreecommitdiffabout
path: root/cgit.c
Unidiff
Diffstat (limited to 'cgit.c') (more/less context) (show whitespace changes)
-rw-r--r--cgit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cgit.c b/cgit.c
index d6146e2..3b3f8d9 100644
--- a/cgit.c
+++ b/cgit.c
@@ -597,33 +597,33 @@ static int generate_cached_repolist(const char *path, const char *cached_rc)
597 fprintf(stderr, "[cgit] Error renaming %s to %s: %s (%d)\n", 597 fprintf(stderr, "[cgit] Error renaming %s to %s: %s (%d)\n",
598 locked_rc, cached_rc, strerror(errno), errno); 598 locked_rc, cached_rc, strerror(errno), errno);
599 fclose(f); 599 fclose(f);
600 return 0; 600 return 0;
601} 601}
602 602
603static void process_cached_repolist(const char *path) 603static void process_cached_repolist(const char *path)
604{ 604{
605 struct stat st; 605 struct stat st;
606 char *cached_rc; 606 char *cached_rc;
607 time_t age; 607 time_t age;
608 unsigned long hash; 608 unsigned long hash;
609 609
610 hash = hash_str(path); 610 hash = hash_str(path);
611 if (ctx.cfg.project_list) 611 if (ctx.cfg.project_list)
612 hash += hash_str(ctx.cfg.project_list); 612 hash += hash_str(ctx.cfg.project_list);
613 cached_rc = xstrdup(fmt("%s/rc-%8x", ctx.cfg.cache_root, hash)); 613 cached_rc = xstrdup(fmt("%s/rc-%8lx", ctx.cfg.cache_root, hash));
614 614
615 if (stat(cached_rc, &st)) { 615 if (stat(cached_rc, &st)) {
616 /* Nothing is cached, we need to scan without forking. And 616 /* Nothing is cached, we need to scan without forking. And
617 * if we fail to generate a cached repolist, we need to 617 * if we fail to generate a cached repolist, we need to
618 * invoke scan_tree manually. 618 * invoke scan_tree manually.
619 */ 619 */
620 if (generate_cached_repolist(path, cached_rc)) { 620 if (generate_cached_repolist(path, cached_rc)) {
621 if (ctx.cfg.project_list) 621 if (ctx.cfg.project_list)
622 scan_projects(path, ctx.cfg.project_list, 622 scan_projects(path, ctx.cfg.project_list,
623 repo_config); 623 repo_config);
624 else 624 else
625 scan_tree(path, repo_config); 625 scan_tree(path, repo_config);
626 } 626 }
627 return; 627 return;
628 } 628 }
629 629