diff options
author | Karel Zak <kzak@redhat.com> | 2007-06-14 11:53:39 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2007-06-14 11:54:44 +0200 |
commit | 41d8815ab7afb67a8b5b55d514f5e9bbe1b7d9fa (patch) | |
tree | 0ca998db461bc0e7d9f63e3bc24f328934b9bb9f /mount | |
parent | 96aef66687db1e5fe06803ba1d244fd9da9f4d13 (diff) | |
download | util-linux-old-41d8815ab7afb67a8b5b55d514f5e9bbe1b7d9fa.tar.gz |
swapon: cleanup PATH_ macros and tailing white-spaces
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount')
-rw-r--r-- | mount/mount_paths.h | 12 | ||||
-rw-r--r-- | mount/swapon.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/mount/mount_paths.h b/mount/mount_paths.h index d726d063..06d5ebf2 100644 --- a/mount/mount_paths.h +++ b/mount/mount_paths.h @@ -2,14 +2,18 @@ #define MOUNT_PATHS_H #include <mntent.h> + #define _PATH_FSTAB "/etc/fstab" +#define PROC_SWAPS "/proc/swaps" + #ifdef _PATH_MOUNTED -#define MOUNTED_LOCK _PATH_MOUNTED "~" -#define MOUNTED_TEMP _PATH_MOUNTED ".tmp" +# define MOUNTED_LOCK _PATH_MOUNTED "~" +# define MOUNTED_TEMP _PATH_MOUNTED ".tmp" #else -#define MOUNTED_LOCK "/etc/mtab~" -#define MOUNTED_TEMP "/etc/mtab.tmp" +# define MOUNTED_LOCK "/etc/mtab~" +# define MOUNTED_TEMP "/etc/mtab.tmp" #endif + #define LOCK_TIMEOUT 10 #define ETC_FILESYSTEMS "/etc/filesystems" diff --git a/mount/swapon.c b/mount/swapon.c index e5f945ed..b4c84f95 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) |