Skip to content

Commit

Permalink
clar: Properly create file in helper
Browse files Browse the repository at this point in the history
  • Loading branch information
vmg committed Apr 3, 2012
1 parent a12c291 commit bbb3723
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests-clar/clar_helpers.c
Expand Up @@ -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;
Expand Down

0 comments on commit bbb3723

Please sign in to comment.