Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
ERROR(xfer->ctx, "Could not link destination file %s: %m\n", xfer->path);
return r;
}
- } else {
+
+ // Link the file descriptor
+ } else if (fd >= 0) {
r = linkat(fd, "", AT_FDCWD, xfer->path, AT_EMPTY_PATH);
if (r) {
ERROR(xfer->ctx, "Could not link destination file %s: %m\n", xfer->path);
return r;
}
+
+ // Fail if we don't know how to link the destination file
+ } else {
+ ERROR(xfer->ctx, "Don't know how to write to the destination file\n");
+ return -ENOTSUP;
}
return 0;