summaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-12-18 23:07:42 +0000
committerDenis Vlasenko2006-12-18 23:07:42 +0000
commit908d6b7054fbe793636d75d50d4af73ad9627c3b (patch)
tree1141f3e3cf5717e6c9b2fa1a788553fd84914b5b /util-linux/mount.c
parent7cfecc4b36c5bd6e1e85fe8851ebd90fe1edb8f4 (diff)
downloadbusybox-908d6b7054fbe793636d75d50d4af73ad9627c3b.zip
busybox-908d6b7054fbe793636d75d50d4af73ad9627c3b.tar.gz
mount: add getmntent_r stub for dietlibc
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r--util-linux/mount.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index f8ae1df..35665a2 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -31,6 +31,20 @@
#include <rpc/pmap_clnt.h>
+#if defined(__dietlibc__)
+/* 16.12.2006, Sampo Kellomaki (sampo@iki.fi)
+ * dietlibc-0.30 does not have implementation of getmntent_r() */
+/* OTOH: why we use getmntent_r instead of getmntent? TODO... */
+struct mntent *getmntent_r(FILE* stream, struct mntent* result, char* buffer, int bufsize)
+{
+ /* *** XXX FIXME WARNING: This hack is NOT thread safe. --Sampo */
+ struct mntent* ment = getmntent(stream);
+ memcpy(result, ment, sizeof(struct mntent));
+ return result;
+}
+#endif
+
+
// Not real flags, but we want to be able to check for this.
enum {
MOUNT_USERS = (1<<28)*ENABLE_DESKTOP,
@@ -1564,7 +1578,8 @@ int mount_main(int argc, char **argv)
sizeof(bb_common_bufsiz1)))
{
// Don't show rootfs. FIXME: why??
- if (!strcmp(mtpair->mnt_fsname, "rootfs")) continue;
+ // util-linux 2.12a happily shows rootfs...
+ //if (!strcmp(mtpair->mnt_fsname, "rootfs")) continue;
if (!fstype || !strcmp(mtpair->mnt_type, fstype))
printf("%s on %s type %s (%s)\n", mtpair->mnt_fsname,