Commit Diff


commit - 2cf2727869f4962f1624068c72a409a05b7b5fc7
commit + ec629cf4ad5084d3f423ea1b906903baa050918e
blob - 761975ce8a9b4b3f7a1c3bf5726bd2248bdd9296
blob + 7f871577f71bf7ed192f9f4d4775c3309b27e7b0
--- gotwebd/gotweb.c
+++ gotwebd/gotweb.c
@@ -856,18 +856,11 @@ gotweb_render_index(struct request *c)
 	struct transport *t = c->t;
 	struct querystring *qs = t->qs;
 	struct repo_dir *repo_dir = NULL;
-	DIR *d;
 	struct dirent **sd_dent = NULL;
 	unsigned int d_cnt, d_i, d_disp = 0;
 	unsigned int d_skipped = 0;
 	int type;
 
-	d = opendir(srv->repos_path);
-	if (d == NULL) {
-		error = got_error_from_errno2("opendir", srv->repos_path);
-		return error;
-	}
-
 	d_cnt = scandir(srv->repos_path, &sd_dent, NULL, alphasort);
 	if (d_cnt == -1) {
 		sd_dent = NULL;
@@ -948,8 +941,6 @@ done:
 			free(sd_dent[d_i]);
 		free(sd_dent);
 	}
-	if (d != NULL && closedir(d) == EOF && error == NULL)
-		error = got_error_from_errno("closedir");
 	return error;
 }