X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/2ed790f3541cd5803b285bb46b2cba02103cc88b..9439c0cb5a4b020b9bfcfe0351e33c17b9c53b54:/rsync.h?ds=sidebyside diff --git a/rsync.h b/rsync.h index 4717e35b..53989bd9 100644 --- a/rsync.h +++ b/rsync.h @@ -811,6 +811,12 @@ typedef struct { #include "proto.h" +#ifndef SUPPORT_XATTRS +#define x_stat(fn,fst,xst) do_stat(fn,fst) +#define x_lstat(fn,fst,xst) do_lstat(fn,fst) +#define x_fstat(fd,fst,xst) do_fstat(fd,fst) +#endif + /* We have replacement versions of these if they're missing. */ #ifndef HAVE_ASPRINTF int asprintf(char **ptr, const char *format, ...); @@ -1029,6 +1035,26 @@ int inet_pton(int af, const char *src, void *dst); const char *get_panic_action(void); #endif +static inline int to_wire_mode(mode_t mode) +{ +#ifdef SUPPORT_LINKS +#if _S_IFLNK != 0120000 + if (S_ISLNK(mode)) + return (mode & ~(_S_IFMT)) | 0120000; +#endif +#endif + return mode; +} + +static inline mode_t from_wire_mode(int mode) +{ +#if _S_IFLNK != 0120000 + if ((mode & (_S_IFMT)) == 0120000) + return (mode & ~(_S_IFMT)) | _S_IFLNK; +#endif + return mode; +} + static inline int isDigit(const char *ptr) {