diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-05-04 16:05:14 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-05-04 16:05:14 -0700 |
commit | 674a198599aa3a77b7edff3f864e3e8779059e36 (patch) | |
tree | 7be1c5f00c824291b0eefe12e055ffcfe8cc6db6 | |
parent | 1adf8c6a9c2c0d8b4936bfc35b84357b13f5a2b2 (diff) | |
download | libgit2-674a198599aa3a77b7edff3f864e3e8779059e36.tar.gz |
clar: Properly create files in helper
-rw-r--r-- | tests-clar/clar_helpers.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests-clar/clar_helpers.c b/tests-clar/clar_helpers.c index fc4ac7350..697614095 100644 --- a/tests-clar/clar_helpers.c +++ b/tests-clar/clar_helpers.c @@ -30,18 +30,17 @@ 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); + int fd = open(filename, flags, 0644); 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) { - cl_git_write2file(filename, new_content, O_WRONLY | O_APPEND | O_CREAT); + cl_git_write2file(filename, new_content, O_WRONLY | O_CREAT | O_APPEND); } void cl_git_rewritefile(const char *filename, const char *new_content) |