From fe1c1a4c4e6b31344411947540cf97a13f560132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Tue, 6 Oct 2015 16:45:48 +0200 Subject: [PATCH] csync2: keep strlcpy for glibc, disable for musl --- srcpkgs/csync2/patches/musl-strlcpy.patch | 18 +++++++++++ srcpkgs/csync2/patches/remove-strlcpy.patch | 36 --------------------- 2 files changed, 18 insertions(+), 36 deletions(-) create mode 100644 srcpkgs/csync2/patches/musl-strlcpy.patch delete mode 100644 srcpkgs/csync2/patches/remove-strlcpy.patch diff --git a/srcpkgs/csync2/patches/musl-strlcpy.patch b/srcpkgs/csync2/patches/musl-strlcpy.patch new file mode 100644 index 00000000000..5b9342f55c4 --- /dev/null +++ b/srcpkgs/csync2/patches/musl-strlcpy.patch @@ -0,0 +1,18 @@ +--- rsync.c 2015-03-09 15:08:51.000000000 +0100 ++++ rsync.c 2015-10-06 16:44:57.988159380 +0200 +@@ -39,6 +39,7 @@ + #endif + + ++#if defined(__GLIBC__) + /* This has been taken from rsync:lib/compat.c */ + + /** +@@ -61,6 +62,7 @@ + } + return ret; + } ++#endif + + /* splits filepath at the last '/', if any, like so: + * dirname basename filepath diff --git a/srcpkgs/csync2/patches/remove-strlcpy.patch b/srcpkgs/csync2/patches/remove-strlcpy.patch deleted file mode 100644 index 75332e89b3d..00000000000 --- a/srcpkgs/csync2/patches/remove-strlcpy.patch +++ /dev/null @@ -1,36 +0,0 @@ -The declaration of strlcpy conflicts with the musl libc -implementation. The libc (GNU or musl) implementation -should be sufficient in any case. - ---- rsync.c 2015-03-09 15:08:51.000000000 +0100 -+++ rsync.c 2015-10-06 16:39:10.499186490 +0200 -@@ -39,29 +39,6 @@ - #endif - - --/* This has been taken from rsync:lib/compat.c */ -- --/** -- * Like strncpy but does not 0 fill the buffer and always null -- * terminates. -- * -- * @param bufsize is the size of the destination buffer. -- * -- * @return index of the terminating byte. -- **/ --static size_t strlcpy(char *d, const char *s, size_t bufsize) --{ -- size_t len = strlen(s); -- size_t ret = len; -- if (bufsize > 0) { -- if (len >= bufsize) -- len = bufsize-1; -- memcpy(d, s, len); -- d[len] = 0; -- } -- return ret; --} -- - /* splits filepath at the last '/', if any, like so: - * dirname basename filepath - * "/" "" "/"