1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 17:57:59 +00:00

with-lock: close segment file before invoking subprocess

This commit is contained in:
Thomas Waldmann 2017-09-06 03:49:45 +02:00
parent 9afec263c9
commit b9dce0ebdc

View file

@ -1467,6 +1467,9 @@ def do_with_lock(self, args, repository):
# the encryption key (and can operate just with encrypted data). # the encryption key (and can operate just with encrypted data).
data = repository.get(Manifest.MANIFEST_ID) data = repository.get(Manifest.MANIFEST_ID)
repository.put(Manifest.MANIFEST_ID, data) repository.put(Manifest.MANIFEST_ID, data)
# usually, a 0 byte (open for writing) segment file would be visible in the filesystem here.
# we write and close this file, to rather have a valid segment file on disk, before invoking the subprocess.
repository.io.close_segment()
try: try:
# we exit with the return code we get from the subprocess # we exit with the return code we get from the subprocess
return subprocess.call([args.command] + args.args) return subprocess.call([args.command] + args.args)