diff options
| author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-12-05 07:24:08 +0000 |
|---|---|---|
| committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-12-05 07:24:08 +0000 |
| commit | 49ec1a2dc6dfba670b3659286524fd5baf12e6fe (patch) | |
| tree | f11db23c430298ac9da2f3de80ec6c86cc75be70 /util-linux | |
| parent | 8a500b97872ecfd6495c1cb6be98bc594627b311 (diff) | |
| download | busybox-w32-49ec1a2dc6dfba670b3659286524fd5baf12e6fe.tar.gz busybox-w32-49ec1a2dc6dfba670b3659286524fd5baf12e6fe.tar.bz2 busybox-w32-49ec1a2dc6dfba670b3659286524fd5baf12e6fe.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
git-svn-id: svn://busybox.net/trunk/busybox@6101 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/mount.c | 82 |
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 | ||
| 60 | enum { | 57 | enum { |
| 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", | ||
| 255 | 0 }; | ||
| 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 | ||
| 367 | static void show_mounts(char *onlytype) | 329 | static 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 | ||
| 439 | extern int mount_main(int argc, char **argv) | 359 | extern int mount_main(int argc, char **argv) |
