From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] git-tar-tree: cleanup trailer writing
Date: Fri, 27 May 2005 23:16:24 +0200 [thread overview]
Message-ID: <20050527211624.GA17478@lsrfire.ath.cx> (raw)
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();
}
}
reply other threads:[~2005-05-27 21:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050527211624.GA17478@lsrfire.ath.cx \
--to=rene.scharfe@lsrfire.ath.cx \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).