From 4e270e3f480c6786d17722ea97ed72d374b66051 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 28 Nov 2007 14:35:24 +0100 Subject: 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 --- mount/swapon.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mount/swapon.c') 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 @@ -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) { -- cgit v1.2.3-55-g7522