git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] mailsplit: remove unnecessary unlink(2) call

From
René Scharfe <l.s.r@web.de>
Date
Oct 4, 2014, 08:41 UTC
Message-ID
<542FB2A9.3020705@web.de>

The output file hasn't been created at this point, yet, so there is no need to delete it when exiting early.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
Original thread: http://thread.gmane.org/gmane.comp.version-control.git/255140
 builtin/mailsplit.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c
index 763cda0..8e02ea1 100644
--- a/builtin/mailsplit.c
+++ b/builtin/mailsplit.c
@@ -59,7 +59,6 @@ static int split_one(FILE *mbox, const char *name, int allow_bare)
 	int is_bare = !is_from_line(buf.buf, buf.len);
 
 	if (is_bare && !allow_bare) {
-		unlink(name);
 		fprintf(stderr, "corrupt mailbox\n");
 		exit(1);
 	}
-- 
2.1.2
Message 1 of 1 in “mailsplit: remove unnecessary unlink(2) call”
  1. mailsplit: remove unnecessary unlink(2) callRené Scharfe, Oct 4, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.