From: Holger Eitzenberger <holger@my-eitzenberger.de>
To: git <git@vger.kernel.org>
Subject: [PATCH 1/1] git: use git_mkstemp() instead of mkstemp()
Date: Thu, 04 Aug 2005 22:49:49 +0200 [thread overview]
Message-ID: <42F27F6D.5070903@my-eitzenberger.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 64 bytes --]
prep_temp_blob: use git_mkstemp() instead of mkstemp()
/holger
[-- Attachment #2: git_use_git_mkstemp.patch --]
[-- Type: text/x-patch, Size: 1201 bytes --]
prep_temp_blob: use git_mkstemp() instead of mkstemp()
---
commit 43bac92063c8dd8d88b33cb838530d4bb3dcad25
tree aeb8bdc2aa285df1fc4888e66fe88b4a8a5e2b3b
parent 1a1f2cb5c27ed26e6ef8dd34209e561bdf256c22
author Holger Eitzenberger <holger@my-eitzenberger.de> Thu, 04 Aug 2005 22:30:43 +0200
committer Holger Eitzenberger <holger@elmo.intranet.astaro.de> Thu, 04 Aug 2005 22:30:43 +0200
diff.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
--- a/diff.c
+++ b/diff.c
@@ -41,11 +41,13 @@ static const char *external_diff(void)
return external_diff_cmd;
}
+#define TEMPFILE_PATH_LEN 50
+
static struct diff_tempfile {
const char *name; /* filename external diff should read from */
char hex[41];
char mode[10];
- char tmp_path[50];
+ char tmp_path[TEMPFILE_PATH_LEN];
} diff_temp[2];
static int count_lines(const char *filename)
@@ -421,8 +423,7 @@ static void prep_temp_blob(struct diff_t
{
int fd;
- strcpy(temp->tmp_path, ".diff_XXXXXX");
- fd = mkstemp(temp->tmp_path);
+ fd = git_mkstemp(temp->tmp_path, TEMPFILE_PATH_LEN, ".diff_XXXXXX");
if (fd < 0)
die("unable to create temp-file");
if (write(fd, blob, size) != size)
reply other threads:[~2005-08-04 23:09 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=42F27F6D.5070903@my-eitzenberger.de \
--to=holger@my-eitzenberger.de \
--cc=git@vger.kernel.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).