diff options
author | Galin Simeonov <gts@volconst.com> | 2021-09-26 19:12:03 +0300 |
---|---|---|
committer | Galin Simeonov <gts@volconst.com> | 2021-09-26 19:12:03 +0300 |
commit | 2057bf1eb5aaf0a9fea2beb8083a3052936b34ea (patch) | |
tree | 19a2324ec951ce6d4b81de766d18d6d17b3e61a0 /system_part.c | |
parent | 7211f9c57204dc3b27327fc92352d99ad080a8db (diff) | |
download | volgit-2057bf1eb5aaf0a9fea2beb8083a3052936b34ea.tar.gz |
generates a tree dump for the HEAD of all the branches
Diffstat (limited to 'system_part.c')
-rw-r--r-- | system_part.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/system_part.c b/system_part.c index aaf2301..526f9be 100644 --- a/system_part.c +++ b/system_part.c @@ -83,33 +83,20 @@ FILE* create_file(int branch_dir,const char *filename) die("Could not open the file '%s' for one of the branches\n",filename); return fdopen(fd,"w"); } -int create_files_dir(int branch_dir) +int create_dir(int base_dir,const char *dir_name) { int ret; - - ret=openat(branch_dir,"files",O_DIRECTORY|O_RDONLY); + ret=openat(base_dir,dir_name,O_DIRECTORY|O_RDONLY); if(ret!=-1) return ret; - ret=mkdirat(branch_dir,"files",0770); + mkdirat(base_dir,dir_name,0770); + ret=openat(base_dir,dir_name,O_DIRECTORY|O_RDONLY); if(ret==-1) die("Could not create the 'files' subdirectory of one of the branch dirs\n"); return ret; } -int create_diff_dir(int branch_dir) -{ - int ret; - - ret=openat(branch_dir,"diffs",O_DIRECTORY|O_RDONLY); - if(ret!=-1) - return ret; - mkdirat(branch_dir,"diffs",0770); - ret=openat(branch_dir,"diffs",O_DIRECTORY|O_RDONLY); - if(ret==-1) - die("Could not create the 'diffs' subdirectory of one of the branch dirs\n"); - return ret; -} void die(const char *format, ...) { |