git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-tar-tree: cleanup trailer writing
@ 2005-05-27 21:16 Rene Scharfe
  0 siblings, 0 replies; only message in thread
From: Rene Scharfe @ 2005-05-27 21:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

Replace open-coded variants of get_record().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>

Index: tar-tree.c
===================================================================
--- ba1de5878d8e0cd1c7c728379e033ea6bf8567e5/tar-tree.c  (mode:100644)
+++ fa5c736eeabbead4a4c024051d104930d836092a/tar-tree.c  (mode:100644)
@@ -73,16 +73,13 @@
  */
 static void write_trailer(void)
 {
-	memset(block + offset, 0, RECORDSIZE);
-	offset += RECORDSIZE;
+	get_record();
 	write_if_needed();
-	memset(block + offset, 0, RECORDSIZE);
-	offset += RECORDSIZE;
+	get_record();
 	write_if_needed();
-	if (offset) {
-		memset(block + offset, 0, BLOCKSIZE - offset);
-		reliable_write(block, BLOCKSIZE);
-		offset = 0;
+	while (offset) {
+		get_record();
+		write_if_needed();
 	}
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-27 21:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-27 21:16 [PATCH] git-tar-tree: cleanup trailer writing Rene Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).