summaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-10-24 05:00:29 +0000
committerEric Andersen <andersen@codepoet.org>2001-10-24 05:00:29 +0000
commitbdfd0d78bc44e73d693510e70087857785b3b521 (patch)
tree153a573095afac8d8d0ea857759ecabd77fb28b7 /util-linux/mount.c
parent9260fc5552a3ee52eb95823aa6689d52a1ffd33c (diff)
downloadbusybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.gz
busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.bz2
busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.zip
Major rework of the directory structure and the entire build system.
-Erik
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r--util-linux/mount.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index af57a7623..bfa9a3040 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -52,7 +52,7 @@
52#include <mntent.h> 52#include <mntent.h>
53#include <ctype.h> 53#include <ctype.h>
54#include "busybox.h" 54#include "busybox.h"
55#if defined BB_FEATURE_USE_DEVPS_PATCH 55#if defined CONFIG_FEATURE_USE_DEVPS_PATCH
56# include <linux/devmtab.h> /* For Erik's nifty devmtab device driver */ 56# include <linux/devmtab.h> /* For Erik's nifty devmtab device driver */
57#endif 57#endif
58 58
@@ -74,7 +74,7 @@ enum {
74}; 74};
75 75
76 76
77#if defined BB_FEATURE_MOUNT_LOOP 77#if defined CONFIG_FEATURE_MOUNT_LOOP
78#include <fcntl.h> 78#include <fcntl.h>
79#include <sys/ioctl.h> 79#include <sys/ioctl.h>
80static int use_loop = FALSE; 80static int use_loop = FALSE;
@@ -123,13 +123,13 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
123 char *mtab_opts, int mount_all) 123 char *mtab_opts, int mount_all)
124{ 124{
125 int status = 0; 125 int status = 0;
126#if defined BB_FEATURE_MOUNT_LOOP 126#if defined CONFIG_FEATURE_MOUNT_LOOP
127 char *lofile = NULL; 127 char *lofile = NULL;
128#endif 128#endif
129 129
130 if (fakeIt == FALSE) 130 if (fakeIt == FALSE)
131 { 131 {
132#if defined BB_FEATURE_MOUNT_LOOP 132#if defined CONFIG_FEATURE_MOUNT_LOOP
133 if (use_loop==TRUE) { 133 if (use_loop==TRUE) {
134 int loro = flags & MS_RDONLY; 134 int loro = flags & MS_RDONLY;
135 135
@@ -162,7 +162,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
162 /* If the mount was sucessful, do anything needed, then return TRUE */ 162 /* If the mount was sucessful, do anything needed, then return TRUE */
163 if (status == 0 || fakeIt==TRUE) { 163 if (status == 0 || fakeIt==TRUE) {
164 164
165#if defined BB_FEATURE_MTAB_SUPPORT 165#if defined CONFIG_FEATURE_MTAB_SUPPORT
166 if (useMtab == TRUE) { 166 if (useMtab == TRUE) {
167 erase_mtab(specialfile); // Clean any stale entries 167 erase_mtab(specialfile); // Clean any stale entries
168 write_mtab(specialfile, dir, filesystemtype, flags, mtab_opts); 168 write_mtab(specialfile, dir, filesystemtype, flags, mtab_opts);
@@ -172,7 +172,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
172 } 172 }
173 173
174 /* Bummer. mount failed. Clean up */ 174 /* Bummer. mount failed. Clean up */
175#if defined BB_FEATURE_MOUNT_LOOP 175#if defined CONFIG_FEATURE_MOUNT_LOOP
176 if (lofile != NULL) { 176 if (lofile != NULL) {
177 del_loop(specialfile); 177 del_loop(specialfile);
178 } 178 }
@@ -209,7 +209,7 @@ parse_mount_options(char *options, int *flags, char *strflags)
209 } 209 }
210 f++; 210 f++;
211 } 211 }
212#if defined BB_FEATURE_MOUNT_LOOP 212#if defined CONFIG_FEATURE_MOUNT_LOOP
213 if (gotone == FALSE && !strcasecmp("loop", options)) { /* loop device support */ 213 if (gotone == FALSE && !strcasecmp("loop", options)) { /* loop device support */
214 use_loop = TRUE; 214 use_loop = TRUE;
215 gotone = TRUE; 215 gotone = TRUE;
@@ -240,7 +240,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
240{ 240{
241 int status = 0; 241 int status = 0;
242 242
243#if defined BB_FEATURE_USE_DEVPS_PATCH 243#if defined CONFIG_FEATURE_USE_DEVPS_PATCH
244 if (strcmp(filesystemType, "auto") == 0) { 244 if (strcmp(filesystemType, "auto") == 0) {
245 static const char *noauto_array[] = { "tmpfs", "shm", "proc", "ramfs", "devpts", "devfs", "usbdevfs", 0 }; 245 static const char *noauto_array[] = { "tmpfs", "shm", "proc", "ramfs", "devpts", "devfs", "usbdevfs", 0 };
246 const char **noauto_fstype; 246 const char **noauto_fstype;
@@ -310,7 +310,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
310 310
311void show_mounts(void) 311void show_mounts(void)
312{ 312{
313#if defined BB_FEATURE_USE_DEVPS_PATCH 313#if defined CONFIG_FEATURE_USE_DEVPS_PATCH
314 int fd, i, numfilesystems; 314 int fd, i, numfilesystems;
315 char device[] = "/dev/mtab"; 315 char device[] = "/dev/mtab";
316 struct k_mntent *mntentlist; 316 struct k_mntent *mntentlist;
@@ -337,7 +337,7 @@ void show_mounts(void)
337 mntentlist[i].mnt_opts, mntentlist[i].mnt_freq, 337 mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
338 mntentlist[i].mnt_passno); 338 mntentlist[i].mnt_passno);
339 } 339 }
340#ifdef BB_FEATURE_CLEAN_UP 340#ifdef CONFIG_FEATURE_CLEAN_UP
341 /* Don't bother to close files or free memory. Exit 341 /* Don't bother to close files or free memory. Exit
342 * does that automagically, so we can save a few bytes */ 342 * does that automagically, so we can save a few bytes */
343 free( mntentlist); 343 free( mntentlist);
@@ -357,7 +357,7 @@ void show_mounts(void)
357 } 357 }
358 printf("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir, 358 printf("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir,
359 m->mnt_type, m->mnt_opts); 359 m->mnt_type, m->mnt_opts);
360#ifdef BB_FEATURE_CLEAN_UP 360#ifdef CONFIG_FEATURE_CLEAN_UP
361 if(blockDevice != m->mnt_fsname) 361 if(blockDevice != m->mnt_fsname)
362 free(blockDevice); 362 free(blockDevice);
363#endif 363#endif
@@ -408,7 +408,7 @@ extern int mount_main(int argc, char **argv)
408 case 'f': 408 case 'f':
409 fakeIt = TRUE; 409 fakeIt = TRUE;
410 break; 410 break;
411#ifdef BB_FEATURE_MTAB_SUPPORT 411#ifdef CONFIG_FEATURE_MTAB_SUPPORT
412 case 'n': 412 case 'n':
413 useMtab = FALSE; 413 useMtab = FALSE;
414 break; 414 break;
@@ -467,7 +467,7 @@ extern int mount_main(int argc, char **argv)
467singlemount: 467singlemount:
468 string_flags = strdup(string_flags); 468 string_flags = strdup(string_flags);
469 rc = EXIT_SUCCESS; 469 rc = EXIT_SUCCESS;
470#ifdef BB_NFSMOUNT 470#ifdef CONFIG_NFSMOUNT
471 if (strchr(device, ':') != NULL) 471 if (strchr(device, ':') != NULL)
472 filesystemType = "nfs"; 472 filesystemType = "nfs";
473 if (strcmp(filesystemType, "nfs") == 0) { 473 if (strcmp(filesystemType, "nfs") == 0) {