Skip to content

Commit

Permalink
Remove unused safe_create_wronly function
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Jan 8, 2016
1 parent ccefd47 commit 1cfcfb1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion ccache.h
Expand Up @@ -152,7 +152,6 @@ char *dirname(const char *path);
const char *get_extension(const char *path);
char *remove_extension(const char *path);
size_t file_size(struct stat *st);
int safe_create_wronly(const char *fname);
char *format_human_readable_size(uint64_t size);
char *format_parsable_size_with_suffix(uint64_t size);
bool parse_size_with_suffix(const char *str, uint64_t *size);
Expand Down
19 changes: 0 additions & 19 deletions util.c
Expand Up @@ -1060,25 +1060,6 @@ file_size(struct stat *st)
#endif
}

/*
* Create a file for writing. Creates parent directories if they don't exist.
*/
int
safe_create_wronly(const char *fname)
{
int fd = open(fname, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0666);
if (fd == -1 && errno == ENOENT) {
/*
* Only make sure parent directories exist when have failed to open the
* file -- this saves stat() calls.
*/
if (create_parent_dirs(fname) == 0) {
fd = open(fname, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0666);
}
}
return fd;
}

/* Format a size as a human-readable string. Caller frees. */
char *
format_human_readable_size(uint64_t v)
Expand Down

0 comments on commit 1cfcfb1

Please sign in to comment.