mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 00:12:15 +00:00
chmod for writability when writing test files
This commit is contained in:
parent
a1d0802576
commit
17f1c9fb33
@ -31,11 +31,12 @@ void cl_git_mkfile(const char *filename, const char *content)
|
|||||||
void cl_git_write2file(const char *filename, const char *new_content, int flags)
|
void cl_git_write2file(const char *filename, const char *new_content, int flags)
|
||||||
{
|
{
|
||||||
int fd = p_open(filename, flags);
|
int fd = p_open(filename, flags);
|
||||||
cl_assert(fd != 0);
|
cl_assert(fd >= 0);
|
||||||
if (!new_content)
|
if (!new_content)
|
||||||
new_content = "\n";
|
new_content = "\n";
|
||||||
cl_must_pass(p_write(fd, new_content, strlen(new_content)));
|
cl_must_pass(p_write(fd, new_content, strlen(new_content)));
|
||||||
cl_must_pass(p_close(fd));
|
cl_must_pass(p_close(fd));
|
||||||
|
cl_must_pass(p_chmod(filename, 0644));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cl_git_append2file(const char *filename, const char *new_content)
|
void cl_git_append2file(const char *filename, const char *new_content)
|
||||||
|
Loading…
Reference in New Issue
Block a user