summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich2011-07-10 22:40:21 +0000
committerJo-Philipp Wich2011-07-10 22:40:21 +0000
commita8d4a6ce563b6cc3f51138aa7b4b06ea2309c280 (patch)
tree0a0547e5bfa2f5efcaf8869a55dff6c6f9f3b2eb
parent871bab410b6320b06a5791a8fee0aad31e3c7be6 (diff)
downloadpackages-a8d4a6ce563b6cc3f51138aa7b4b06ea2309c280.tar.gz
mdadm: add missing functions posix_memalign() and canonicalize_file_name() to work with backfire/uClibc 0.9.30
SVN-Revision: 27581
-rw-r--r--utils/mdadm/patches/200-uclibc_0.9.30_compat.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/utils/mdadm/patches/200-uclibc_0.9.30_compat.patch b/utils/mdadm/patches/200-uclibc_0.9.30_compat.patch
new file mode 100644
index 000000000..4b3d158d0
--- /dev/null
+++ b/utils/mdadm/patches/200-uclibc_0.9.30_compat.patch
@@ -0,0 +1,42 @@
+Index: mdadm-3.2/mdadm.h
+===================================================================
+--- mdadm-3.2.orig/mdadm.h 2011-02-01 06:06:21.000000000 +0100
++++ mdadm-3.2/mdadm.h 2011-07-11 00:36:52.135848368 +0200
+@@ -33,6 +33,37 @@
+ # endif
+ #endif
+
++#ifdef UCLIBC
++# include <features.h>
++# if __UCLIBC_MINOR__ <= 9 && __UCLIBC_SUBLEVEL__ <= 30
++
++#include <errno.h>
++void *memalign(size_t blocksize, size_t bytes);
++static inline int posix_memalign(void **memptr, size_t alignment, size_t size)
++{
++ if (alignment % sizeof(void *) != 0)
++ return EINVAL;
++
++ *memptr = memalign(alignment, size);
++ return (*memptr != NULL ? 0 : ENOMEM);
++}
++
++#include <limits.h>
++char *strdup(const char *s);
++char *realpath(const char *path, char *resolved_path);
++static inline char *canonicalize_file_name(const char *path)
++{
++ char resolved[PATH_MAX] = { 0 };
++
++ if (!realpath(path, resolved))
++ return NULL;
++
++ return strdup(resolved);
++}
++
++# endif /* __UCLIBC_MINOR__ <= 9 && __UCLIBC_SUBLEVEL__ <= 30 */
++#endif /* UCLIBC */
++
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <stdlib.h>