diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2005-08-06 07:00:03 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2005-08-06 07:00:03 +0000 |
commit | 81b4c05b47e57505f56742b9349bee21116ba704 (patch) | |
tree | 171179a0a7b22a5af981da0124ac3f8d1bc1cef2 /common/textfile.c | |
parent | 7ba9b7fda144865222a5d254b36bf484d5af99e7 (diff) |
Remove the create_dirs() function
Diffstat (limited to 'common/textfile.c')
-rw-r--r-- | common/textfile.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/common/textfile.c b/common/textfile.c index 08cd5a9f..a5d0a58b 100644 --- a/common/textfile.c +++ b/common/textfile.c @@ -41,40 +41,6 @@ #include <sys/mman.h> #include <sys/param.h> -static int create_dirs(char *filename, mode_t mode) -{ - struct stat st; - char dir[PATH_MAX + 1], *prev, *next; - int err; - - err = stat(filename, &st); - if (!err && S_ISREG(st.st_mode)) - return 0; - - memset(dir, 0, PATH_MAX + 1); - strcat(dir, "/"); - - prev = strchr(filename, '/'); - - while (prev) { - next = strchr(prev + 1, '/'); - if (!next) - break; - - if (next - prev == 1) { - prev = next; - continue; - } - - strncat(dir, prev + 1, next - prev); - mkdir(dir, mode); - - prev = next; - } - - return 0; -} - static inline int write_key_value(int fd, char *key, char *value) { char *str; |