Description: Fix FTBFS on hurd
 mremap is Linux specific and not available on hurd. Fix this with a fake
 mremap.
Author: Cyril Roelandt <tipecaml@gmail.com>
Origin: vendor
Bug-Debian: http://bugs.debian.org/670546
Forwarded: no
Reviewed-by: Ryan Kavanagh <rak@debian.org>
Last-Update: 2012-04-27
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
diff --git a/buffer.c b/buffer.c
index ebec0da..2501e03 100644
--- a/buffer.c
+++ b/buffer.c
@@ -23,6 +23,16 @@
  *	and for undo histories.
  */
 
+#ifndef __linux__
+static inline void *fake_mremap(void *old_address, size_t old_size, size_t new_size, int flags)
+{
+	(void) flags;
+	munmap(old_address, old_size);
+	return mmap(old_address, new_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+}
+#define mremap fake_mremap
+#endif
+
 struct buffer *buffer_create(char *path)
 {
 	struct buffer *buffer = allocate0(sizeof *buffer);
