aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-12-05 07:24:08 +0000
committerEric Andersen <andersen@codepoet.org>2002-12-05 07:24:08 +0000
commitdeca106b6dad70ad0a1312a82d762aa8d8ad52ba (patch)
treef11db23c430298ac9da2f3de80ec6c86cc75be70 /util-linux/mount.c
parent6f9b45b9eff22c664b93ace82d20669340a762f8 (diff)
downloadbusybox-w32-deca106b6dad70ad0a1312a82d762aa8d8ad52ba.tar.gz
busybox-w32-deca106b6dad70ad0a1312a82d762aa8d8ad52ba.tar.bz2
busybox-w32-deca106b6dad70ad0a1312a82d762aa8d8ad52ba.zip
Kill CONFIG_FEATURE_USE_DEVPS_PATCH and the devps patch. I'm not
maintaining it anymore, and it is now terribly out of date. -Erik
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r--util-linux/mount.c82
1 files changed, 1 insertions, 81 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 829d31666..32d0dd5b9 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -53,9 +53,6 @@
53#include <mntent.h> 53#include <mntent.h>
54#include <ctype.h> 54#include <ctype.h>
55#include "busybox.h" 55#include "busybox.h"
56#if defined CONFIG_FEATURE_USE_DEVPS_PATCH
57# include <linux/devmtab.h> /* For Erik's nifty devmtab device driver */
58#endif
59 56
60enum { 57enum {
61 MS_MGC_VAL = 0xc0ed0000, /* Magic number indicatng "new" flags */ 58 MS_MGC_VAL = 0xc0ed0000, /* Magic number indicatng "new" flags */
@@ -247,39 +244,6 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType,
247 int mount_all) 244 int mount_all)
248{ 245{
249 int status = 0; 246 int status = 0;
250
251#if defined CONFIG_FEATURE_USE_DEVPS_PATCH
252 if (strcmp(filesystemType, "auto") == 0) {
253 static const char *noauto_array[] =
254 { "tmpfs", "shm", "proc", "ramfs", "devpts", "devfs", "usbdevfs",
2550 };
256 const char **noauto_fstype;
257 const int num_of_filesystems = sysfs(3, 0, 0);
258 char buf[255];
259 int i = 0;
260
261 filesystemType = buf;
262
263 while (i < num_of_filesystems) {
264 sysfs(2, i++, filesystemType);
265 for (noauto_fstype = noauto_array; *noauto_fstype;
266 noauto_fstype++) {
267 if (!strcmp(filesystemType, *noauto_fstype)) {
268 break;
269 }
270 }
271 if (!*noauto_fstype) {
272 status =
273 do_mount(blockDevice, directory, filesystemType,
274 flags | MS_MGC_VAL, string_flags, useMtab,
275 fakeIt, mtab_opts, mount_all);
276 if (status) {
277 break;
278 }
279 }
280 }
281 }
282#else
283 if (strcmp(filesystemType, "auto") == 0) { 247 if (strcmp(filesystemType, "auto") == 0) {
284 char buf[255]; 248 char buf[255];
285 FILE *f; 249 FILE *f;
@@ -346,9 +310,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType,
346 } 310 }
347 } 311 }
348 fclose(f); 312 fclose(f);
349 } 313 } else {
350#endif
351 else {
352 status = 314 status =
353 do_mount(blockDevice, directory, filesystemType, 315 do_mount(blockDevice, directory, filesystemType,
354 flags | MS_MGC_VAL, string_flags, useMtab, fakeIt, 316 flags | MS_MGC_VAL, string_flags, useMtab, fakeIt,
@@ -366,47 +328,6 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType,
366 328
367static void show_mounts(char *onlytype) 329static void show_mounts(char *onlytype)
368{ 330{
369#if defined CONFIG_FEATURE_USE_DEVPS_PATCH
370 int fd, i, numfilesystems;
371 char device[] = "/dev/mtab";
372 struct k_mntent *mntentlist;
373
374 /* open device */
375 fd = open(device, O_RDONLY);
376 if (fd < 0) {
377 perror_msg_and_die("open failed for `%s'", device);
378 }
379
380 /* How many mounted filesystems? We need to know to
381 * allocate enough space for later... */
382 numfilesystems = ioctl(fd, DEVMTAB_COUNT_MOUNTS);
383 if (numfilesystems < 0) {
384 perror_msg_and_die("\nDEVMTAB_COUNT_MOUNTS");
385 }
386 mntentlist =
387 (struct k_mntent *) xcalloc(numfilesystems, sizeof(struct k_mntent));
388
389 /* Grab the list of mounted filesystems */
390 if (ioctl(fd, DEVMTAB_GET_MOUNTS, mntentlist) < 0) {
391 perror_msg_and_die("\nDEVMTAB_GET_MOUNTS");
392 }
393
394 for (i = 0; i < numfilesystems; i++) {
395 if (!onlytype || (strcmp(mntentlist[i].mnt_type, onlytype) == 0)) {
396 printf("%s %s %s %s %d %d\n", mntentlist[i].mnt_fsname,
397 mntentlist[i].mnt_dir, mntentlist[i].mnt_type,
398 mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
399 mntentlist[i].mnt_passno);
400 }
401 }
402#ifdef CONFIG_FEATURE_CLEAN_UP
403 /* Don't bother to close files or free memory. Exit
404 * does that automagically, so we can save a few bytes */
405 free(mntentlist);
406 close(fd);
407#endif
408 exit(EXIT_SUCCESS);
409#else
410 FILE *mountTable = setmntent(mtab_file, "r"); 331 FILE *mountTable = setmntent(mtab_file, "r");
411 332
412 if (mountTable) { 333 if (mountTable) {
@@ -433,7 +354,6 @@ static void show_mounts(char *onlytype)
433 perror_msg_and_die("%s", mtab_file); 354 perror_msg_and_die("%s", mtab_file);
434 } 355 }
435 exit(EXIT_SUCCESS); 356 exit(EXIT_SUCCESS);
436#endif
437} 357}
438 358
439extern int mount_main(int argc, char **argv) 359extern int mount_main(int argc, char **argv)