summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-05-02 16:44:47 -0700
committerRussell Belfer <rb@github.com>2012-05-02 16:44:47 -0700
commit17f1c9fb332d054285452313f0ec537dfde63d1c (patch)
treee3d9ff6591696776f5f4d9a8ca53b76e936f6f8d
parenta1d0802576a158c74af07c0e46a3e2adb5075fba (diff)
downloadlibgit2-17f1c9fb332d054285452313f0ec537dfde63d1c.tar.gz
chmod for writability when writing test files
-rw-r--r--tests-clar/clar_helpers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests-clar/clar_helpers.c b/tests-clar/clar_helpers.c
index 4d9ee4f77..8604078df 100644
--- a/tests-clar/clar_helpers.c
+++ b/tests-clar/clar_helpers.c
@@ -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)