From c1a4af4abc5e313fe364f8d1f2b58e89679d2b8b Mon Sep 17 00:00:00 2001
From: brian <brian>
Date: Thu, 10 Jul 2008 21:29:54 +0000
Subject: [PATCH] Need to include mount_utils.h in the _SOURCES for the tools
 that use it. Compile fixes from adilger.

---
 lustre/utils/Makefile.am    | 4 ++--
 lustre/utils/mkfs_lustre.c  | 2 +-
 lustre/utils/mount_lustre.c | 2 +-
 lustre/utils/mount_utils.c  | 7 +++----
 lustre/utils/mount_utils.h  | 2 ++
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am
index 4066a9a451..aa02674637 100644
--- a/lustre/utils/Makefile.am
+++ b/lustre/utils/Makefile.am
@@ -80,11 +80,11 @@ llog_reader_DEPENDENCIES := $(LIBPTLCTL)
 
 lr_reader_SOURCES = lr_reader.c
 
-mount_lustre_SOURCES = mount_lustre.c mount_utils.c
+mount_lustre_SOURCES = mount_lustre.c mount_utils.c mount_utils.h
 mount_lustre_LDADD := $(LIBPTLCTL)
 mount_lustre_DEPENDENCIES := $(LIBPTLCTL)
 
-mkfs_lustre_SOURCES = mkfs_lustre.c mount_utils.c
+mkfs_lustre_SOURCES = mkfs_lustre.c mount_utils.c mount_utils.h
 mkfs_lustre_CPPFLAGS = -UTUNEFS $(AM_CPPFLAGS)
 mkfs_lustre_LDADD := libiam.a $(LIBPTLCTL)
 mkfs_lustre_DEPENDENCIES := $(LIBPTLCTL) libiam.a
diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c
index 25de036595..b6a7f260c9 100644
--- a/lustre/utils/mkfs_lustre.c
+++ b/lustre/utils/mkfs_lustre.c
@@ -50,7 +50,7 @@
 #include <lustre_param.h>
 #include <lnet/lnetctl.h>
 #include <lustre_ver.h>
-#include <mount_utils.h>
+#include "mount_utils.h"
 
 #ifndef PATH_MAX
 #define PATH_MAX 4096
diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c
index 455f8bc117..0ac707c648 100644
--- a/lustre/utils/mount_lustre.c
+++ b/lustre/utils/mount_lustre.c
@@ -38,7 +38,7 @@
 #include <glob.h>
 #include <ctype.h>
 #include <limits.h>
-#include <mount_utils.h>
+#include "mount_utils.h"
 
 #define MAX_HW_SECTORS_KB_PATH  "queue/max_hw_sectors_kb"
 #define MAX_SECTORS_KB_PATH     "queue/max_sectors_kb"
diff --git a/lustre/utils/mount_utils.c b/lustre/utils/mount_utils.c
index 17d00d760a..0ee497432f 100644
--- a/lustre/utils/mount_utils.c
+++ b/lustre/utils/mount_utils.c
@@ -10,8 +10,8 @@
 extern char *progname;
 extern int verbose;
 
-#define vprint if (verbose > 0) printf
-#define verrprint if (verbose >= 0) printf
+#define vprint(fmt, arg...) if (verbose > 0) printf(fmt, ##arg)
+#define verrprint(fmt, arg...) if (verbose >= 0) fprintf(stderr, fmt, ##arg)
 
 void fatal(void)
 {
@@ -73,8 +73,7 @@ int get_mountdata(char *dev, struct lustre_disk_data *mo_ldd)
 
         /* Make a temporary directory to hold Lustre data files. */
         if (!mkdtemp(tmpdir)) {
-                verrprint(stderr, "%s: Can't create temporary "
-                        "directory %s: %s\n",
+                verrprint("%s: Can't create temporary directory %s: %s\n",
                         progname, tmpdir, strerror(errno));
                 return errno;
         }
diff --git a/lustre/utils/mount_utils.h b/lustre/utils/mount_utils.h
index 600b6b40e1..3311b0fbec 100644
--- a/lustre/utils/mount_utils.h
+++ b/lustre/utils/mount_utils.h
@@ -6,6 +6,8 @@
 #ifndef _MOUNT_UTILS_H_
 #define _MOUNT_UTILS_H_
 
+#include <lustre_disk.h>
+
 void fatal(void);
 int run_command(char *, int);
 int get_mountdata(char *, struct lustre_disk_data *);
-- 
GitLab