public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: Re: [PATCH 3/3] xfsqa: build dbtest on debian platforms
Date: Thu, 29 Apr 2010 16:49:43 +1000	[thread overview]
Message-ID: <20100429064943.GB3774@dastard> (raw)
In-Reply-To: <1272500186-29393-4-git-send-email-david@fromorbit.com>

On Thu, Apr 29, 2010 at 10:16:26AM +1000, Dave Chinner wrote:
> Set up autoconf to find the correct headers and compat libraries for
> debian squeeze, and massage the includes to ensure the right headers get
> included. Also fix a compile warning that was emitted now that it is being
> compiled.
> 
> Signed-off-by: Dave Chinner <david@fromorbit.com>

I missed a O_WRONLY->O_RDWR dbm_open fix (forgot to refresh the
patch before sending the patchbomb) in this, so it builds but
doesn't run.

Updated patch below.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

xfsqa: build dbtest on debian platforms

Set up autoconf to find the correct headers and compat libraries for
debian squeeze, and massage the includes to ensure the right headers get
included. Also fix a compile warning that was emitted now that it is being
compiled.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 m4/package_gdbmdev.m4 |    8 ++++++--
 src/dbtest.c          |   24 ++++++++++++------------
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/m4/package_gdbmdev.m4 b/m4/package_gdbmdev.m4
index d826acd..6580fba 100644
--- a/m4/package_gdbmdev.m4
+++ b/m4/package_gdbmdev.m4
@@ -6,9 +6,13 @@ AC_DEFUN([AC_PACKAGE_WANT_NDBM],
   ])
 
 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
-  [ AC_CHECK_HEADERS([gdbm/ndbm.h], [ have_db=true ], [ have_db=false ])
+  [ AC_CHECK_HEADERS([gdbm/ndbm.h, gdbm-ndbm.h], [ have_db=true ], [ have_db=false ])
+    libgdbm=""
+    if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm_compat.a; then
+	libgdbm="${libexecdir}${libdirsuffix}/libgdbm_compat.a"
+    fi
     if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm.a; then
-	libgdbm="${libexecdir}${libdirsuffix}/libgdbm.a"
+	libgdbm="${libgdbm} ${libexecdir}${libdirsuffix}/libgdbm.a"
     fi
     AC_SUBST(libgdbm)
     AC_SUBST(have_db)
diff --git a/src/dbtest.c b/src/dbtest.c
index 48667b7..ec8db0b 100644
--- a/src/dbtest.c
+++ b/src/dbtest.c
@@ -18,19 +18,17 @@
  
 #include "global.h"
 
-#ifdef HAVE_GDBM_NDBM_H
+#ifdef HAVE_GDBM_NDBM_H_
 #include <gdbm/ndbm.h>
-#else
-#ifdef HAVE_GDBM_H
+#elif HAVE_GDBM_NDBM_H
+#include <gdbm-ndbm.h>
+#elif HAVE_GDBM_H
 #include <gdbm.h>
-#else
-#ifdef HAVE_NDBM_H
+#elif HAVE_NDBM_H
 #include <ndbm.h>
 #else
 bozo!
 #endif
-#endif
-#endif
 
 
 /* #define WorkDir	"/xfs" */
@@ -140,11 +138,12 @@ int InitDbmLookup(int howmany)
 
 	sprintf(filename, "%s-%d", DBNAME, (int)getpid());
 	if (debugflg) {
-		printf("dbm_open(%s, O_WRONLY|O_CREAT, 0644)\n", filename);
+		printf("dbm_open(%s, O_RDWR|O_CREAT, 0644)\n", filename);
 		fflush(stdout);
 	}
-	dbm = dbm_open(filename, O_WRONLY|O_CREAT, 0644);
-	if(dbm == NULL) DoSysError("\ndbm_open", (int)dbm);
+	dbm = dbm_open(filename, O_RDWR|O_CREAT, 0644);
+	if(dbm == NULL)
+		DoSysError("\ndbm_open", -1);
 
 	if ((KeyArray = (unsigned short *)calloc( howmany,
 				sizeof(unsigned short))) == NULL)
@@ -191,11 +190,12 @@ int InitDbmLookup(int howmany)
 	}
 	dbm_close(dbm); /* close to eliminate chance of in-memory caching */
 	if (debugflg) {
-		printf("dbm_open(%s, O_RDNLY, 0)\n", filename);
+		printf("dbm_open(%s, O_RDONLY, 0)\n", filename);
 		fflush(stdout);
 	}
 	dbm = dbm_open(filename, O_RDONLY, 0);
-	if(dbm == NULL) DoSysError("\ndbm_open", (int)dbm);
+	if(dbm == NULL)
+		DoSysError("\ndbm_open", -1);
 	return 0;
 }
 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-04-29  6:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-29  0:16 [PATCH 0/3] xfstests: miscellaneous patches Dave Chinner
2010-04-29  0:16 ` [PATCH 1/3] xfsqa: clean up 030 repair output Dave Chinner
2010-04-29 10:18   ` Christoph Hellwig
2010-04-29  0:16 ` [PATCH 2/3] xfsqa: keep xfs_fsr output around in test 222 Dave Chinner
2010-04-29 10:19   ` Christoph Hellwig
2010-04-29  0:16 ` [PATCH 3/3] xfsqa: build dbtest on debian platforms Dave Chinner
2010-04-29  6:49   ` Dave Chinner [this message]
2010-04-29 10:20     ` Christoph Hellwig
2010-04-29 10:46     ` Christoph Hellwig
2010-04-30  1:26       ` Dave Chinner
2010-04-30  2:28         ` Alex Elder
2010-04-30  3:20           ` Eric Sandeen
2010-04-30  8:55           ` Dave Chinner
2010-04-30 16:39             ` Christoph Hellwig
2010-04-30 17:24               ` Alex Elder
2010-04-29 10:20   ` Christoph Hellwig

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=20100429064943.GB3774@dastard \
    --to=david@fromorbit.com \
    --cc=xfs@oss.sgi.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