aboutsummaryrefslogtreecommitdiff
path: root/swapon.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-10-18 21:22:59 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-10-18 21:22:59 +0000
commit1e03a3215a59734b26ac16154e611c19b8ae7478 (patch)
treeae74dfbfd1ea2d85e54673de631471ab40fc277a /swapon.c
parent4f31b9ecebd9a5b0c4164ae4cb1f1814f1ca15a3 (diff)
downloadbusybox-w32-1e03a3215a59734b26ac16154e611c19b8ae7478.tar.gz
busybox-w32-1e03a3215a59734b26ac16154e611c19b8ae7478.tar.bz2
busybox-w32-1e03a3215a59734b26ac16154e611c19b8ae7478.zip
More fixes
git-svn-id: svn://busybox.net/trunk/busybox@32 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'swapon.c')
-rw-r--r--swapon.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/swapon.c b/swapon.c
deleted file mode 100644
index 78360a55f..000000000
--- a/swapon.c
+++ /dev/null
@@ -1,34 +0,0 @@
1#include <stdio.h>
2#include <mntent.h>
3#include <sys/swap.h>
4#include "internal.h"
5
6const char swapon_usage[] = "swapon block-device\n"
7"\n"
8"\tSwap virtual memory pages on the given device.\n";
9
10extern int
11swapon_fn(const struct FileInfo * i)
12{
13 FILE *swapsTable;
14 struct mntent m;
15
16 if (!(swapon(i->source, 0))) {
17 if ((swapsTable = setmntent("/etc/swaps", "a+"))) {
18 /* Needs the cast to avoid warning about conversion from
19 * const char* to just char*
20 */
21 m.mnt_fsname = (char*)i->source;
22 m.mnt_dir = "none";
23 m.mnt_type = "swap";
24 m.mnt_opts = "sw";
25 m.mnt_freq = 0;
26 m.mnt_passno = 0;
27 addmntent(swapsTable, &m);
28 endmntent(swapsTable);
29 }
30 return (0);
31 }
32 return (-1);
33}
34