From a95e5286a4c06cf447f6943a01063863b61a99fa Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Fri, 29 Jun 2018 16:12:30 +1000 Subject: [PATCH] tdb: Fix build on AIX BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Here is the build error on AIX 7.1. ../../lib/tdb/tools/tdbtool.c:39:12: error: 'disable_lock' redeclared as different kind of symbol static int disable_lock; ^~~~~~~~~~~~ In file included from /usr/include/sys/gfs.h:24:0, from /usr/include/sys/vfs.h:27, from ../../lib/replace/system/filesys.h:48, from ../../lib/tdb/tools/tdbtool.c:26: /usr/include/sys/lock_def.h:314:5: note: previous declaration of 'disable_lock' was here int disable_lock(int,simple_lock_t); ^~~~~~~~~~~~ Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke (cherry picked from commit edffe4d16514fa0c87655e040842f6c20d89791c) --- lib/tdb/tools/tdbtool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tdb/tools/tdbtool.c b/lib/tdb/tools/tdbtool.c index e3535b93c7c..7a36ce2b71a 100644 --- a/lib/tdb/tools/tdbtool.c +++ b/lib/tdb/tools/tdbtool.c @@ -36,7 +36,7 @@ char *line; TDB_DATA iterate_kbuf; char cmdline[1024]; static int disable_mmap; -static int disable_lock; +static int _disable_lock; enum commands { CMD_CREATE_TDB, @@ -263,7 +263,7 @@ static void create_tdb(const char *tdbname) tdb = tdb_open_ex(tdbname, 0, TDB_CLEAR_IF_FIRST | (disable_mmap?TDB_NOMMAP:0) | - (disable_lock?TDB_NOLOCK:0), + (_disable_lock?TDB_NOLOCK:0), O_RDWR | O_CREAT | O_TRUNC, 0600, &log_ctx, NULL); if (!tdb) { printf("Could not create %s: %s\n", tdbname, strerror(errno)); @@ -278,7 +278,7 @@ static void open_tdb(const char *tdbname) if (tdb) tdb_close(tdb); tdb = tdb_open_ex(tdbname, 0, (disable_mmap?TDB_NOMMAP:0) | - (disable_lock?TDB_NOLOCK:0), + (_disable_lock?TDB_NOLOCK:0), O_RDWR, 0600, &log_ctx, NULL); @@ -890,7 +890,7 @@ int main(int argc, char *argv[]) arg2len = 0; if (argv[1] && (strcmp(argv[1], "-l") == 0)) { - disable_lock = 1; + _disable_lock = 1; argv[1] = argv[0]; argv += 1; argc -= 1; -- 2.47.2