X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbasic%2Fcopy.c;h=6be7cc37a4519fb00748762af5a0dc9a4666ce82;hb=66ecc207e203db5434610395cd04c40ae8727b58;hp=cff446d9f0595e58e5675a7725475edae289e8ee;hpb=2705eaf36d46539397571886ba6ccd0045ef3e9b;p=elogind.git diff --git a/src/basic/copy.c b/src/basic/copy.c index cff446d9f..6be7cc37a 100644 --- a/src/basic/copy.c +++ b/src/basic/copy.c @@ -1,5 +1,3 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - /*** This file is part of systemd. @@ -19,8 +17,18 @@ along with systemd; If not, see . ***/ +//#include +//#include +//#include +//#include +//#include +//#include +//#include #include +//#include #include +//#include +//#include //#include "alloc-util.h" //#include "btrfs-util.h" @@ -31,10 +39,11 @@ //#include "fileio.h" //#include "fs-util.h" #include "io-util.h" +//#include "macro.h" //#include "string-util.h" #include "strv.h" +#include "time-util.h" //#include "umask-util.h" -#include "util.h" //#include "xattr-util.h" #define COPY_BUFFER_SIZE (16*1024) @@ -45,8 +54,7 @@ int copy_bytes(int fdf, int fdt, uint64_t max_bytes, bool try_reflink) { assert(fdf >= 0); assert(fdt >= 0); -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind /* Try btrfs reflinks first. */ if (try_reflink && max_bytes == (uint64_t) -1 && @@ -65,7 +73,7 @@ int copy_bytes(int fdf, int fdt, uint64_t max_bytes, bool try_reflink) { if (max_bytes != (uint64_t) -1) { if (max_bytes <= 0) - return -EFBIG; + return 1; /* return > 0 if we hit the max_bytes limit */ if ((uint64_t) m > max_bytes) m = (size_t) max_bytes; @@ -129,8 +137,7 @@ int copy_bytes(int fdf, int fdt, uint64_t max_bytes, bool try_reflink) { return 0; /* return 0 if we hit EOF earlier than the size limit */ } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind static int fd_copy_symlink(int df, const char *from, const struct stat *st, int dt, const char *to) { _cleanup_free_ char *target = NULL; int r;