From 8e63751bc3fb83cb0cf7c32e3bc17b3226cafb40 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Mon, 8 Jan 2001 12:48:02 +0000 Subject: remove disable swap --- mdk-stage1/init.c | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) (limited to 'mdk-stage1/init.c') diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c index 4dab49a3b..202993b47 100644 --- a/mdk-stage1/init.c +++ b/mdk-stage1/init.c @@ -311,59 +311,6 @@ void unmount_filesystems(void) } } - -void disable_swap(void) -{ - int fd; - char buf[4096]; - int i; - char * start; - char * chptr; - - printf("disabling swap...\n"); - - fd = open("/proc/swaps", O_RDONLY, 0); - if (fd < 0) { - print_warning("failed to open /proc/swaps"); - return; - } - - /* read all data at once */ - i = read(fd, buf, sizeof(buf) - 1); - close(fd); - if (i < 0) { - print_warning("failed to read /proc/swaps"); - return; - } - buf[i] = '\0'; - - start = buf; - while (*start) { - /* move to next line */ - while (*start != '\n' && *start) start++; - if (!*start) return; - - /* first char of new line */ - start++; - if (*start != '/') return; - - /* build up an ASCIIZ filename */ - chptr = start; - while (*chptr && *chptr != ' ') chptr++; - if (!(*chptr)) return; - *chptr = '\0'; - - /* call swapoff */ - printf("swapoff %s", start); - if (swapoff(start)) - printf(" failed (%d)\n", errno); - else - printf(" succeeded\n"); - - start = chptr + 1; - } -} - int is_rescue() { int fd, size; @@ -501,7 +448,6 @@ int main(int argc, char **argv) sleep(2); printf("done\n"); - disable_swap(); unmount_filesystems(); if (!abnormal_termination) { -- cgit v1.2.1