public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 3/7] mount command: don't include headers multiple times
Date: Mon, 30 Jun 2008 13:10:24 -0400	[thread overview]
Message-ID: <20080630171023.9905.21675.stgit@ellison.1015granger.net> (raw)
In-Reply-To: <20080630170420.9905.90111.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>

Clean up: add the traditional pre-processor safety check in headers under
utils/mount to prevent them from being included multiple times.

For headers that already have this, use a more unique macro name to reduce the
probability that some other header may use the same macro.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/mount/error.h           |    5 +++++
 utils/mount/fstab.h           |    7 +++----
 utils/mount/mount_constants.h |    6 +++---
 utils/mount/network.h         |    5 +++++
 utils/mount/nfs_mount.h       |    6 +++---
 utils/mount/parse_opt.h       |    5 +++++
 utils/mount/stropts.h         |    5 +++++
 utils/mount/token.h           |    5 +++++
 8 files changed, 34 insertions(+), 10 deletions(-)


diff --git a/utils/mount/error.h b/utils/mount/error.h
index 8b8e9ae..7126de5 100644
--- a/utils/mount/error.h
+++ b/utils/mount/error.h
@@ -21,6 +21,9 @@
  *
  */
 
+#ifndef _NFS_UTILS_MOUNT_ERROR_H
+#define _NFS_UTILS_MOUNT_ERROR_H
+
 char *nfs_strerror(int);
 
 void mount_error(const char *, const char *, int);
@@ -28,3 +31,5 @@ void rpc_mount_errors(char *, int, int);
 void sys_mount_errors(char *, int, int, int);
 
 void umount_error(int, const char *);
+
+#endif	/* _NFS_UTILS_MOUNT_ERROR_H */
diff --git a/utils/mount/fstab.h b/utils/mount/fstab.h
index 64c8355..37f17e1 100644
--- a/utils/mount/fstab.h
+++ b/utils/mount/fstab.h
@@ -1,5 +1,5 @@
-#ifndef _NFS_FSTAB_H
-#define _NFS_FSTAB_H
+#ifndef _NFS_UTILS_MOUNT_FSTAB_H
+#define _NFS_UTILS_MOUNT_FSTAB_H
 
 #include "nfs_mntent.h"
 
@@ -26,5 +26,4 @@ void lock_mtab (void);
 void unlock_mtab (void);
 void update_mtab (const char *special, struct mntent *with);
 
-#endif /* _NFS_FSTAB_H */
-
+#endif	/* _NFS_UTILS_MOUNT_FSTAB_H */
diff --git a/utils/mount/mount_constants.h b/utils/mount/mount_constants.h
index 4f3c729..cbfb099 100644
--- a/utils/mount/mount_constants.h
+++ b/utils/mount/mount_constants.h
@@ -1,5 +1,5 @@
-#ifndef _NFS_MOUNT_CONSTANTS_H
-#define _NFS_MOUNT_CONSTANTS_H
+#ifndef _NFS_UTILS_MOUNT_CONSTANTS_H
+#define _NFS_UTILS_MOUNT_CONSTANTS_H
 
 #ifndef MS_DIRSYNC
 #define MS_DIRSYNC	128	/* Directory modifications are synchronous */
@@ -64,4 +64,4 @@ if we have a stack or plain mount - mount atop of it, forming a stack. */
 #define MS_MGC_MSK 0xffff0000	/* magic flag number mask */
 #endif
 
-#endif /* _NFS_MOUNT_CONSTANTS_H */
+#endif	/* _NFS_UTILS_MOUNT_CONSTANTS_H */
diff --git a/utils/mount/network.h b/utils/mount/network.h
index 99ecc1e..e0a5dd5 100644
--- a/utils/mount/network.h
+++ b/utils/mount/network.h
@@ -21,6 +21,9 @@
  *
  */
 
+#ifndef _NFS_UTILS_MOUNT_NETWORK_H
+#define _NFS_UTILS_MOUNT_NETWORK_H
+
 #include <rpc/pmap_prot.h>
 #include <rpc/clnt.h>
 
@@ -60,3 +63,5 @@ unsigned long nfsvers_to_mnt(const unsigned long);
 
 CLIENT *mnt_openclnt(clnt_addr_t *, int *);
 void mnt_closeclnt(CLIENT *, int);
+
+#endif	/* _NFS_UTILS_MOUNT_NETWORK_H */
diff --git a/utils/mount/nfs_mount.h b/utils/mount/nfs_mount.h
index 7df8fb2..2becfb1 100644
--- a/utils/mount/nfs_mount.h
+++ b/utils/mount/nfs_mount.h
@@ -8,8 +8,8 @@
  * so it is easiest to ignore the kernel altogether (at compile time).
  */
 
-#ifndef _NFS_MOUNT_H
-#define _NFS_MOUNT_H
+#ifndef _NFS_UTILS_MOUNT_NFS_MOUNT_H
+#define _NFS_UTILS_MOUNT_NFS_MOUNT_H
 
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -83,4 +83,4 @@ struct nfs_mount_data {
 int	nfsmount(const char *, const char *, int , char **, int, int);
 int	nfsumount(int, char **);
 
-#endif /* _NFS_MOUNT_H */
+#endif	/* _NFS_UTILS_MOUNT_NFS_MOUNT_H */
diff --git a/utils/mount/parse_opt.h b/utils/mount/parse_opt.h
index e7924dd..fb003c3 100644
--- a/utils/mount/parse_opt.h
+++ b/utils/mount/parse_opt.h
@@ -21,6 +21,9 @@
  *
  */
 
+#ifndef _NFS_UTILS_PARSE_OPT_H
+#define _NFS_UTILS_PARSE_OPT_H
+
 typedef enum {
 	PO_FAILED = 0,
 	PO_SUCCEEDED = 1,
@@ -50,3 +53,5 @@ char *			po_get(struct mount_options *, char *);
 po_rightmost_t		po_rightmost(struct mount_options *, char *, char *);
 po_found_t		po_remove_all(struct mount_options *, char *);
 void			po_destroy(struct mount_options *);
+
+#endif	/* _NFS_UTILS_PARSE_OPT_H */
diff --git a/utils/mount/stropts.h b/utils/mount/stropts.h
index b926d68..b4fd888 100644
--- a/utils/mount/stropts.h
+++ b/utils/mount/stropts.h
@@ -21,5 +21,10 @@
  *
  */
 
+#ifndef _NFS_UTILS_MOUNT_STROPTS_H
+#define _NFS_UTILS_MOUNT_STROPTS_H
+
 int nfsmount_string(const char *, const char *, const char *, int,
 			char **, int, int);
+
+#endif	/* _NFS_UTILS_MOUNT_STROPTS_H */
diff --git a/utils/mount/token.h b/utils/mount/token.h
index 47762dc..5a675ed 100644
--- a/utils/mount/token.h
+++ b/utils/mount/token.h
@@ -21,9 +21,14 @@
  *
  */
 
+#ifndef _NFS_UTILS_MOUNT_TOKEN_H
+#define _NFS_UTILS_MOUNT_TOKEN_H
+
 struct tokenizer_state;
 
 char *next_token(struct tokenizer_state *);
 struct tokenizer_state *init_tokenizer(char *, char);
 int tokenizer_error(struct tokenizer_state *);
 void end_tokenizer(struct tokenizer_state *);
+
+#endif	/* _NFS_UTILS_MOUNT_TOKEN_H */


  parent reply	other threads:[~2008-06-30 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-30 17:10 [PATCH 0/7] Patches for nfs-utils-1.1.3 Chuck Lever
     [not found] ` <20080630170420.9905.90111.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-06-30 17:10   ` [PATCH 1/7] Python scripts: Report bandwidth in "kB/s" instead of "Kb/s" Chuck Lever
2008-06-30 17:10   ` [PATCH 2/7] text-based mount command: Make "internal error" message more explicit Chuck Lever
2008-06-30 17:10   ` Chuck Lever [this message]
2008-06-30 17:10   ` [PATCH 4/7] nfs-utils: Add dependency for getaddrinfo(3) in configure.ac Chuck Lever
2008-06-30 17:10   ` [PATCH 5/7] mount: Introduce IPv6-aware DNS resolver API function Chuck Lever
2008-06-30 17:10   ` [PATCH 6/7] mount command: move function to get kernel version to separate header Chuck Lever
2008-06-30 17:10   ` [PATCH 7/7] text-based mount command: pass "sloppy" when -s is set Chuck Lever
2008-07-15 19:30   ` [PATCH 0/7] Patches for nfs-utils-1.1.3 Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080630171023.9905.21675.stgit@ellison.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox