aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /util-linux/mount.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r--util-linux/mount.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index c64c3f438..f665a0875 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -23,13 +23,7 @@
23*/ 23*/
24 24
25#include "busybox.h" 25#include "busybox.h"
26#include <unistd.h>
27#include <errno.h>
28#include <string.h>
29#include <mntent.h> 26#include <mntent.h>
30#include <ctype.h>
31#include <fcntl.h> // for CONFIG_FEATURE_MOUNT_LOOP
32#include <sys/ioctl.h> // for CONFIG_FEATURE_MOUNT_LOOP
33 27
34// These two aren't always defined in old headers 28// These two aren't always defined in old headers
35#ifndef MS_BIND 29#ifndef MS_BIND
@@ -89,12 +83,12 @@ struct {
89static void append_mount_options(char **oldopts, char *newopts) 83static void append_mount_options(char **oldopts, char *newopts)
90{ 84{
91 if(*oldopts && **oldopts) { 85 if(*oldopts && **oldopts) {
92 char *temp=bb_xasprintf("%s,%s",*oldopts,newopts); 86 char *temp=xasprintf("%s,%s",*oldopts,newopts);
93 free(*oldopts); 87 free(*oldopts);
94 *oldopts=temp; 88 *oldopts=temp;
95 } else { 89 } else {
96 if (ENABLE_FEATURE_CLEAN_UP) free(*oldopts); 90 if (ENABLE_FEATURE_CLEAN_UP) free(*oldopts);
97 *oldopts = bb_xstrdup(newopts); 91 *oldopts = xstrdup(newopts);
98 } 92 }
99} 93}
100 94
@@ -165,7 +159,7 @@ static llist_t *get_block_backed_filesystems(void)
165 if(*fs=='#' || *fs=='*') continue; 159 if(*fs=='#' || *fs=='*') continue;
166 if(!*fs) continue; 160 if(!*fs) continue;
167 161
168 llist_add_to_end(&list,bb_xstrdup(fs)); 162 llist_add_to_end(&list,xstrdup(fs));
169 } 163 }
170 if (ENABLE_FEATURE_CLEAN_UP) fclose(f); 164 if (ENABLE_FEATURE_CLEAN_UP) fclose(f);
171 } 165 }
@@ -367,7 +361,7 @@ report_error:
367 361
368int mount_main(int argc, char **argv) 362int mount_main(int argc, char **argv)
369{ 363{
370 char *cmdopts = bb_xstrdup(""), *fstabname, *fstype=0, *storage_path=0; 364 char *cmdopts = xstrdup(""), *fstabname, *fstype=0, *storage_path=0;
371 FILE *fstab; 365 FILE *fstab;
372 int i, opt, all = FALSE, rc = 0; 366 int i, opt, all = FALSE, rc = 0;
373 struct mntent mtpair[2], *mtcur = mtpair; 367 struct mntent mtpair[2], *mtcur = mtpair;
@@ -493,7 +487,7 @@ int mount_main(int argc, char **argv)
493 // Mount the last thing we found. 487 // Mount the last thing we found.
494 488
495 mtcur = mtnext; 489 mtcur = mtnext;
496 mtcur->mnt_opts=bb_xstrdup(mtcur->mnt_opts); 490 mtcur->mnt_opts = xstrdup(mtcur->mnt_opts);
497 append_mount_options(&(mtcur->mnt_opts),cmdopts); 491 append_mount_options(&(mtcur->mnt_opts),cmdopts);
498 rc = singlemount(mtcur, 0); 492 rc = singlemount(mtcur, 0);
499 free(mtcur->mnt_opts); 493 free(mtcur->mnt_opts);