diff options
author | Karel Zak | 2007-06-14 11:53:39 +0200 |
---|---|---|
committer | Karel Zak | 2007-06-14 11:54:44 +0200 |
commit | 41d8815ab7afb67a8b5b55d514f5e9bbe1b7d9fa (patch) | |
tree | 0ca998db461bc0e7d9f63e3bc24f328934b9bb9f /mount/swapon.c | |
parent | misc-utils: remove old cal test (diff) | |
download | kernel-qcow2-util-linux-41d8815ab7afb67a8b5b55d514f5e9bbe1b7d9fa.tar.gz kernel-qcow2-util-linux-41d8815ab7afb67a8b5b55d514f5e9bbe1b7d9fa.tar.xz kernel-qcow2-util-linux-41d8815ab7afb67a8b5b55d514f5e9bbe1b7d9fa.zip |
swapon: cleanup PATH_ macros and tailing white-spaces
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/swapon.c')
-rw-r--r-- | mount/swapon.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/mount/swapon.c b/mount/swapon.c index e5f945ed3..b4c84f958 100644 --- a/mount/swapon.c +++ b/mount/swapon.c @@ -1,8 +1,6 @@ /* * A swapon(8)/swapoff(8) for Linux 0.99. - * swapon.c,v 1.1.1.1 1993/11/18 08:40:51 jrs Exp */ - #include <ctype.h> #include <stdlib.h> #include <stdio.h> @@ -17,6 +15,7 @@ #include "nls.h" #include "fsprobe.h" #include "realpath.h" +#include "mount_paths.h" #ifdef HAVE_SYS_SWAP_H # include <sys/swap.h> @@ -31,9 +30,6 @@ #define streq(s, t) (strcmp ((s), (t)) == 0) -#define _PATH_FSTAB "/etc/fstab" -#define PROC_SWAPS "/proc/swaps" - #define QUIET 1 int all = 0; @@ -145,10 +141,10 @@ display_summary(void) char line[1024] ; if ((swaps = fopen(PROC_SWAPS, "r")) == NULL) { - int errsv = errno; + int errsv = errno; fprintf(stderr, "%s: %s: %s\n", progname, PROC_SWAPS, strerror(errsv)); - return -1 ; + return -1; } while (fgets(line, sizeof(line), swaps)) @@ -320,7 +316,7 @@ swapon_all(void) { (!ifexists || !access(special, R_OK))) { /* parse mount options; */ char *opt, *opts = strdup(fstab->mnt_opts); - + for (opt = strtok(opts, ","); opt != NULL; opt = strtok(NULL, ",")) { if (strncmp(opt, "pri=", 4) == 0) |