"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
remove unused imsgbuf
To:
gameoftrees@openbsd.org
Date:
Wed, 20 Nov 2024 06:38:23 +0100

Download raw body.

Thread
subject says it all.  we don't seem to actually use this, it's just
initialized, flushed and released.

diff /home/op/w/gotmain
commit - 3065f08c041aa183200511b6371a883e945f3187
path + /home/op/w/gotmain
blob - 30d239c18fcd5fcef9ecbdf30b78181cf9c03088
file + gotd/repo_write.c
--- gotd/repo_write.c
+++ gotd/repo_write.c
@@ -1211,7 +1211,6 @@ recv_packfile(int *have_packfile, struct imsg *imsg)
 	} repo_tempfiles[3] = { { - 1, - 1 }, { - 1, - 1 }, { - 1, - 1 }, };
 	int i;
 	size_t datalen;
-	struct imsgbuf ibuf;
 	struct got_ratelimit rl;
 	struct got_pack *pack = NULL;
 	off_t pack_filesize = 0;
@@ -1230,8 +1229,6 @@ recv_packfile(int *have_packfile, struct imsg *imsg)
 	if (client->pack_pipe == -1 || client->packidx_fd == -1)
 		return got_error(GOT_ERR_PRIVSEP_NO_FD);
 
-	imsg_init(&ibuf, client->fd);
-
 	pack = &client->pack;
 	memset(pack, 0, sizeof(*pack));
 	pack->fd = imsg_get_fd(imsg);
@@ -1267,10 +1264,6 @@ recv_packfile(int *have_packfile, struct imsg *imsg)
 		tempfiles[i] = f;
 	}
 
-	err = gotd_imsg_flush(&ibuf);
-	if (err)
-		goto done;
-
 	log_debug("receiving pack data");
 	unpack_err = recv_packdata(&pack_filesize, &nobj,
 	    client->pack_sha1, client->pack_pipe, pack->fd);
@@ -1355,7 +1348,6 @@ done:
 	}
 	if (err)
 		got_pack_close(pack);
-	imsg_clear(&ibuf);
 	return err;
 }