]> err.no Git - util-linux/commitdiff
swapon: cleanup PATH_ macros and tailing white-spaces
authorKarel Zak <kzak@redhat.com>
Thu, 14 Jun 2007 09:53:39 +0000 (11:53 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 14 Jun 2007 09:54:44 +0000 (11:54 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
mount/mount_paths.h
mount/swapon.c

index d726d0631b4fed1e2a9794fe9b996fa83600a2f5..06d5ebf23100522c866728e61d8a6aac2a30efb6 100644 (file)
@@ -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"
index e5f945ed3190e905d8729443ea67265836e44e9c..b4c84f9585f69dd827a588b14a30ce6cdc0f7704 100644 (file)
@@ -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)