tmpfiles: Make C still copy if the destination directory is empty

Fixes #11287.
This commit is contained in:
Ryan Gonzalez 2019-01-06 18:12:31 -06:00
parent 609d34736f
commit a6f4464571
2 changed files with 6 additions and 6 deletions

View file

@ -282,11 +282,11 @@ L /tmp/foobar - - - - /dev/null</programlisting>
<varlistentry>
<term><varname>C</varname></term>
<listitem><para>Recursively copy a file or directory, if the
destination files or directories do not exist yet. Note that
this command will not descend into subdirectories if the
destination directory already exists. Instead, the entire
copy operation is skipped. If the argument is omitted, files
from the source directory
destination files or directories do not exist yet or the
destination directory is empty. Note that this command will not
descend into subdirectories if the destination directory already
exists and is not empty. Instead, the entire copy operation is
skipped. If the argument is omitted, files from the source directory
<filename>/usr/share/factory/</filename> with the same name
are copied. Does not follow symlinks.</para></listitem>
</varlistentry>

View file

@ -1463,7 +1463,7 @@ static int copy_files(Item *i) {
dfd, bn,
i->uid_set ? i->uid : UID_INVALID,
i->gid_set ? i->gid : GID_INVALID,
COPY_REFLINK);
COPY_REFLINK | COPY_MERGE_EMPTY);
if (r < 0) {
struct stat a, b;