MCPcopy Create free account
hub / github.com/git/git / mks_tempfile_tsm

Function mks_tempfile_tsm

tempfile.c:186–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186struct tempfile *mks_tempfile_tsm(const char *filename_template, int suffixlen, int mode)
187{
188 struct tempfile *tempfile = new_tempfile();
189 const char *tmpdir;
190
191 tmpdir = getenv("TMPDIR");
192 if (!tmpdir)
193 tmpdir = "/tmp";
194
195 strbuf_addf(&tempfile->filename, "%s/%s", tmpdir, filename_template);
196 tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);
197 if (tempfile->fd < 0) {
198 deactivate_tempfile(tempfile);
199 return NULL;
200 }
201 activate_tempfile(tempfile);
202 return tempfile;
203}
204
205struct tempfile *mks_tempfile_dt(const char *directory_template,
206 const char *filename)

Callers 3

mks_tempfile_tsFunction · 0.85
mks_tempfile_tmFunction · 0.85
mks_tempfile_tFunction · 0.85

Calls 5

new_tempfileFunction · 0.85
strbuf_addfFunction · 0.85
git_mkstemps_modeFunction · 0.85
deactivate_tempfileFunction · 0.85
activate_tempfileFunction · 0.85

Tested by

no test coverage detected