From bbb3723657cb595754099036ee080849b218f285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicent=20Mart=C3=AD?= Date: Wed, 4 Apr 2012 01:30:18 +0200 Subject: [PATCH] clar: Properly create file in helper --- tests-clar/clar_helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests-clar/clar_helpers.c b/tests-clar/clar_helpers.c index 22db56f0c71..e90bb87377f 100644 --- a/tests-clar/clar_helpers.c +++ b/tests-clar/clar_helpers.c @@ -30,13 +30,12 @@ void cl_git_mkfile(const char *filename, const char *content) void cl_git_append2file(const char *filename, const char *new_content) { - int fd = p_open(filename, O_WRONLY | O_APPEND | O_CREAT); + int fd = p_creat(filename, 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)); } static const char *_cl_sandbox = NULL;