Skip to content

Commit

Permalink
Fix missing deletion of CLEAN_DIR directories
Browse files Browse the repository at this point in the history
The actual deletion of directories which where added to CLEAN_DIRS by
out_of_the_way() is missing in the code:

buczek@theinternet:~/git/cmirror (fix-printf-formats)$ rm -rf /scratch/local/a
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ rm -rf /scratch/local/b
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ mkdir /scratch/local/a
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ touch /scratch/local/a/test
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ mkdir /scratch/local/b
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ mkdir /scratch/local/b/test
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ cmirror --delete  /scratch/local/a /scratch/local/b
theinternet.molgen.mpg.de: creating empty ./test
theinternet.molgen.mpg.de: rm -r ./test.deleteme
theinternet.molgen.mpg.de: fix directory mtime of . -> 1661234914
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ find /scratch/local/b
/scratch/local/b
/scratch/local/b/test.deleteme
/scratch/local/b/test

Add call to remove directory.
  • Loading branch information
donald committed Aug 23, 2022
1 parent 80b0d48 commit b069db6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,10 @@ static void slave(char *slave_path) {
}
GSList *d = CLEAN_DIRS;
while (d) {
char *path = (char *)d->data;
if (!quiet)
warn("rm -r %s\n", (char *)d->data);
warn("rm -r %s\n", path);
fileop_rmdir_recurse(path);
d = d->next;
}
}
Expand Down

0 comments on commit b069db6

Please sign in to comment.