client: Correctly clean up temporary files
The function "build_rsync_main_cmd" is called in a subshell, so it can't effectively modify it's parent variable "temp_files". To correctly cleanup those temporary files, we do it when this specific function exits.
This commit is contained in:
parent
f1d4e6ed9d
commit
9510546d48
|
@ -402,7 +402,8 @@ build_rsync_main_cmd() {
|
||||||
includes_file="$(mktemp "${PROGNAME}.includes.XXXXXX")"
|
includes_file="$(mktemp "${PROGNAME}.includes.XXXXXX")"
|
||||||
excludes_file="$(mktemp "${PROGNAME}.excludes.XXXXXX")"
|
excludes_file="$(mktemp "${PROGNAME}.excludes.XXXXXX")"
|
||||||
# … and add them to the list of files to delete at exit
|
# … and add them to the list of files to delete at exit
|
||||||
temp_files="${temp_files} ${includes_file} ${excludes_file}"
|
temp_files="${includes_file} ${excludes_file}"
|
||||||
|
trap "rm -f ${temp_files}" EXIT
|
||||||
|
|
||||||
# Store includes/excludes in files
|
# Store includes/excludes in files
|
||||||
# without blank lines of comments (# or ;)
|
# without blank lines of comments (# or ;)
|
||||||
|
|
Loading…
Reference in a new issue