From a0e17f7df6d4c65ecab7339e9899b294ff8bc04e Mon Sep 17 00:00:00 2001
From: Denis Vlasenko <vda.linux@googlemail.com>
Date: Mon, 26 May 2008 01:19:53 +0000
Subject: [u]mount: add/update dietlibc build fix

---
 util-linux/mount.c  |  6 +++---
 util-linux/umount.c | 11 +++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/util-linux/mount.c b/util-linux/mount.c
index 3cfbc5600..2efa77644 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -46,11 +46,11 @@
 #if defined(__dietlibc__)
 /* 16.12.2006, Sampo Kellomaki (sampo@iki.fi)
  * dietlibc-0.30 does not have implementation of getmntent_r() */
-static struct mntent *getmntent_r(FILE* stream, struct mntent* result, char* buffer, int bufsize)
+static struct mntent *getmntent_r(FILE* stream, struct mntent* result,
+		char* buffer ATTRIBUTE_UNUSED, int bufsize ATTRIBUTE_UNUSED)
 {
 	struct mntent* ment = getmntent(stream);
-	memcpy(result, ment, sizeof(struct mntent));
-	return result;
+	return memcpy(result, ment, sizeof(*ment));
 }
 #endif
 
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 34c979e0c..9fa3cd2d3 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -11,6 +11,17 @@
 #include <mntent.h>
 #include "libbb.h"
 
+#if defined(__dietlibc__)
+/* 16.12.2006, Sampo Kellomaki (sampo@iki.fi)
+ * dietlibc-0.30 does not have implementation of getmntent_r() */
+static struct mntent *getmntent_r(FILE* stream, struct mntent* result,
+		char* buffer ATTRIBUTE_UNUSED, int bufsize ATTRIBUTE_UNUSED)
+{
+	struct mntent* ment = getmntent(stream);
+	return memcpy(result, ment, sizeof(*ment));
+}
+#endif
+
 /* ignored: -v -d -t -i */
 #define OPTION_STRING           "fldnra" "vdt:i"
 #define OPT_FORCE               (1 << 0)
-- 
cgit v1.2.3-55-g6feb