summaryrefslogtreecommitdiffstats
path: root/mount/swapon.c
diff options
context:
space:
mode:
authorKarel Zak2007-11-28 14:35:24 +0100
committerKarel Zak2007-11-28 14:35:24 +0100
commit4e270e3f480c6786d17722ea97ed72d374b66051 (patch)
tree6dedecf19f6a773aecdb49537d6ddab96afdeb4c /mount/swapon.c
parentinclude: add mount paths to pathnames.h (diff)
downloadkernel-qcow2-util-linux-4e270e3f480c6786d17722ea97ed72d374b66051.tar.gz
kernel-qcow2-util-linux-4e270e3f480c6786d17722ea97ed72d374b66051.tar.xz
kernel-qcow2-util-linux-4e270e3f480c6786d17722ea97ed72d374b66051.zip
mount: cleanup usage of _PATH_*
The macros MOUNTED and MNTTAB are deprecated. This patch standardize and consolidate all path macros and remove mount_paths.h. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/swapon.c')
-rw-r--r--mount/swapon.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mount/swapon.c b/mount/swapon.c
index 6c2c4866c..2c8b4fc2f 100644
--- a/mount/swapon.c
+++ b/mount/swapon.c
@@ -15,7 +15,7 @@
#include "nls.h"
#include "fsprobe.h"
#include "realpath.h"
-#include "mount_paths.h"
+#include "pathnames.h"
#ifdef HAVE_SYS_SWAP_H
# include <sys/swap.h>
@@ -108,14 +108,14 @@ read_proc_swaps(void) {
numSwaps = 0;
swapFiles = NULL;
- swaps = fopen(PROC_SWAPS, "r");
+ swaps = fopen(_PATH_PROC_SWAPS, "r");
if (swaps == NULL)
return; /* nothing wrong */
/* skip the first line */
if (!fgets(line, sizeof(line), swaps)) {
fprintf (stderr, _("%s: %s: unexpected file format\n"),
- progname, PROC_SWAPS);
+ progname, _PATH_PROC_SWAPS);
fclose(swaps);
return;
}
@@ -161,9 +161,9 @@ display_summary(void)
FILE *swaps;
char line[1024] ;
- if ((swaps = fopen(PROC_SWAPS, "r")) == NULL) {
+ if ((swaps = fopen(_PATH_PROC_SWAPS, "r")) == NULL) {
int errsv = errno;
- fprintf(stderr, "%s: %s: %s\n", progname, PROC_SWAPS,
+ fprintf(stderr, "%s: %s: %s\n", progname, _PATH_PROC_SWAPS,
strerror(errsv));
return -1;
}
@@ -313,11 +313,11 @@ swapon_all(void) {
read_proc_swaps();
- fp = setmntent(_PATH_FSTAB, "r");
+ fp = setmntent(_PATH_MNTTAB, "r");
if (fp == NULL) {
int errsv = errno;
fprintf(stderr, _("%s: cannot open %s: %s\n"),
- progname, _PATH_FSTAB, strerror(errsv));
+ progname, _PATH_MNTTAB, strerror(errsv));
exit(2);
}
@@ -504,11 +504,11 @@ main_swapoff(int argc, char *argv[]) {
* Probably it was unmounted already, so errors are not bad.
* Doing swapoff -a twice should not give error messages.
*/
- fp = setmntent(_PATH_FSTAB, "r");
+ fp = setmntent(_PATH_MNTTAB, "r");
if (fp == NULL) {
int errsv = errno;
fprintf(stderr, _("%s: cannot open %s: %s\n"),
- progname, _PATH_FSTAB, strerror(errsv));
+ progname, _PATH_MNTTAB, strerror(errsv));
exit(2);
}
while ((fstab = getmntent(fp)) != NULL) {