Staging
v0.5.1
https://github.com/git/git
Raw File
Tip revision: 297ca895a27a6bbdb7906371d533f72a12ad25b2 authored by Junio C Hamano on 20 January 2022, 23:25:38 UTC
Merge branch 'js/branch-track-inherit'
Tip revision: 297ca89
open.c
#include "git-compat-util.h"

#undef open
int git_open_with_retry(const char *path, int flags, ...)
{
	mode_t mode = 0;
	int ret;

	/*
	 * Also O_TMPFILE would take a mode, but it isn't defined everywhere.
	 * And anyway, we don't use it in our code base.
	 */
	if (flags & O_CREAT) {
		va_list ap;
		va_start(ap, flags);
		mode = va_arg(ap, int);
		va_end(ap);
	}

	do {
		ret = open(path, flags, mode);
	} while (ret < 0 && errno == EINTR);

	return ret;
}
back to top