aboutsummaryrefslogtreecommitdiff
path: root/util-linux/swaponoff.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/swaponoff.c')
-rw-r--r--util-linux/swaponoff.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 918a5bc0e..b323cb10a 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -51,13 +51,13 @@ static int swap_enable_disable(const char *device)
51 struct stat st; 51 struct stat st;
52 52
53 if (stat(device, &st) < 0) { 53 if (stat(device, &st) < 0) {
54 perror_msg_and_die("cannot stat %s"); 54 bb_perror_msg_and_die("cannot stat %s", device);
55 } 55 }
56 56
57 /* test for holes */ 57 /* test for holes */
58 if (S_ISREG(st.st_mode)) { 58 if (S_ISREG(st.st_mode)) {
59 if (st.st_blocks * 512 < st.st_size) { 59 if (st.st_blocks * 512 < st.st_size) {
60 error_msg_and_die("swap file has holes"); 60 bb_error_msg_and_die("swap file has holes");
61 } 61 }
62 } 62 }
63 63
@@ -67,7 +67,7 @@ static int swap_enable_disable(const char *device)
67 status = swapoff(device); 67 status = swapoff(device);
68 68
69 if (status != 0) { 69 if (status != 0) {
70 perror_msg("%s", device); 70 bb_perror_msg("%s", device);
71 return EXIT_FAILURE; 71 return EXIT_FAILURE;
72 } 72 }
73 return EXIT_SUCCESS; 73 return EXIT_SUCCESS;
@@ -80,7 +80,7 @@ static int do_em_all(void)
80 int err = 0; 80 int err = 0;
81 81
82 if (f == NULL) 82 if (f == NULL)
83 perror_msg_and_die("/etc/fstab"); 83 bb_perror_msg_and_die("/etc/fstab");
84 while ((m = getmntent(f)) != NULL) { 84 while ((m = getmntent(f)) != NULL) {
85 if (strcmp(m->mnt_type, MNTTYPE_SWAP)==0) { 85 if (strcmp(m->mnt_type, MNTTYPE_SWAP)==0) {
86 if(swap_enable_disable(m->mnt_fsname) == EXIT_FAILURE) 86 if(swap_enable_disable(m->mnt_fsname) == EXIT_FAILURE)
@@ -94,7 +94,7 @@ static int do_em_all(void)
94 94
95extern int swap_on_off_main(int argc, char **argv) 95extern int swap_on_off_main(int argc, char **argv)
96{ 96{
97 if (applet_name[5] == 'f') { /* "swapoff" */ 97 if (bb_applet_name[5] == 'f') { /* "swapoff" */
98 whichApp = SWAPOFF_APP; 98 whichApp = SWAPOFF_APP;
99 } 99 }
100 100
@@ -113,7 +113,7 @@ extern int swap_on_off_main(int argc, char **argv)
113 struct stat statBuf; 113 struct stat statBuf;
114 114
115 if (stat("/etc/fstab", &statBuf) < 0) 115 if (stat("/etc/fstab", &statBuf) < 0)
116 error_msg_and_die("/etc/fstab file missing"); 116 bb_error_msg_and_die("/etc/fstab file missing");
117 } 117 }
118 return do_em_all(); 118 return do_em_all();
119 break; 119 break;
@@ -124,5 +124,5 @@ extern int swap_on_off_main(int argc, char **argv)
124 return swap_enable_disable(*argv); 124 return swap_enable_disable(*argv);
125 125
126 usage_and_exit: 126 usage_and_exit:
127 show_usage(); 127 bb_show_usage();
128} 128}