summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-01-08 12:48:02 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-01-08 12:48:02 +0000
commit8e63751bc3fb83cb0cf7c32e3bc17b3226cafb40 (patch)
tree092ee1bfe02a0e1c196bae8f2773845ccc8d82e8
parent8f2b95b0c37e82808d4e8eeee9e019d6161d55e9 (diff)
downloaddrakx-backup-do-not-use-8e63751bc3fb83cb0cf7c32e3bc17b3226cafb40.tar
drakx-backup-do-not-use-8e63751bc3fb83cb0cf7c32e3bc17b3226cafb40.tar.gz
drakx-backup-do-not-use-8e63751bc3fb83cb0cf7c32e3bc17b3226cafb40.tar.bz2
drakx-backup-do-not-use-8e63751bc3fb83cb0cf7c32e3bc17b3226cafb40.tar.xz
drakx-backup-do-not-use-8e63751bc3fb83cb0cf7c32e3bc17b3226cafb40.zip
remove disable swap
-rw-r--r--mdk-stage1/init.c54
1 files changed, 0 insertions, 54 deletions
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) {