Commit 17f1c9fb by Russell Belfer

chmod for writability when writing test files

parent a1d08025
......@@ -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)
{
int fd = p_open(filename, flags);
cl_assert(fd != 0);
cl_assert(fd >= 0);
if (!new_content)
new_content = "\n";
cl_must_pass(p_write(fd, new_content, strlen(new_content)));
cl_must_pass(p_close(fd));
cl_must_pass(p_chmod(filename, 0644));
}
void cl_git_append2file(const char *filename, const char *new_content)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment