MCPcopy Index your code
hub / github.com/git/git / xmkstemp_mode

Function xmkstemp_mode

wrapper.c:512–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512int xmkstemp_mode(char *filename_template, int mode)
513{
514 int fd;
515 char origtemplate[PATH_MAX];
516 strlcpy(origtemplate, filename_template, sizeof(origtemplate));
517
518 fd = git_mkstemp_mode(filename_template, mode);
519 if (fd < 0) {
520 int saved_errno = errno;
521 const char *nonrelative_template;
522
523 if (!filename_template[0])
524 filename_template = origtemplate;
525
526 nonrelative_template = absolute_path(filename_template);
527 errno = saved_errno;
528 die_errno("Unable to create temporary file '%s'",
529 nonrelative_template);
530 }
531 return fd;
532}
533
534/*
535 * Some platforms return EINTR from fsync. Since fsync is invoked in some

Callers 2

xmkstempFunction · 0.85
odb_mkstempFunction · 0.85

Calls 3

git_mkstemp_modeFunction · 0.85
absolute_pathFunction · 0.85
die_errnoFunction · 0.85

Tested by

no test coverage detected