From 74bc01e03e96d5a6a318688d2ee8c620f32ce928 Mon Sep 17 00:00:00 2001
From: erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Date: Mon, 7 Feb 2000 05:29:42 +0000
Subject: A few minor updates. ;-)

Seriously though, read the Changelog for busybox 0.42,
which this is about to become...
 -Erik


git-svn-id: svn://busybox.net/trunk/busybox@351 69ca8d6d-28ef-0310-b511-8ec308f3f277
---
 mtab.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

(limited to 'mtab.c')

diff --git a/mtab.c b/mtab.c
index 98e42a383..41d88184b 100644
--- a/mtab.c
+++ b/mtab.c
@@ -5,21 +5,13 @@
 #include <string.h>
 #include <stdio.h>
 #include <mntent.h>
+#include <fstab.h>
 #include <sys/mount.h>
 
 extern const char mtab_file[]; /* Defined in utility.c */
 
-static char *
-stralloc(const char * string)
-{
-	int	length = strlen(string) + 1;
-	char *	n = malloc(length);
-	memcpy(n, string, length);
-	return n;
-}
 
-extern void
-erase_mtab(const char * name)
+void erase_mtab(const char * name)
 {
 	struct mntent	entries[20];
 	int	count = 0;
@@ -39,10 +31,10 @@ erase_mtab(const char * name)
 	}
 
 	while ( (m = getmntent(mountTable)) != 0 ) {
-		entries[count].mnt_fsname = stralloc(m->mnt_fsname);
-		entries[count].mnt_dir = stralloc(m->mnt_dir);
-		entries[count].mnt_type = stralloc(m->mnt_type);
-		entries[count].mnt_opts = stralloc(m->mnt_opts);
+		entries[count].mnt_fsname = strdup(m->mnt_fsname);
+		entries[count].mnt_dir = strdup(m->mnt_dir);
+		entries[count].mnt_type = strdup(m->mnt_type);
+		entries[count].mnt_opts = strdup(m->mnt_opts);
 		entries[count].mnt_freq = m->mnt_freq;
 		entries[count].mnt_passno = m->mnt_passno;
 		count++;
@@ -65,8 +57,7 @@ erase_mtab(const char * name)
 		perror(mtab_file);
 }
 
-extern void 
-write_mtab(char* blockDevice, char* directory, 
+void write_mtab(char* blockDevice, char* directory, 
 	char* filesystemType, long flags, char* string_flags)
 {
 	FILE *mountTable = setmntent(mtab_file, "a+");
@@ -110,4 +101,3 @@ write_mtab(char* blockDevice, char* directory,
     }
 }
 
-
-- 
cgit v1.2.3-55-g6feb