From: Amitay Isaacs Date: Fri, 29 Jun 2018 06:12:30 +0000 (+1000) Subject: tdb: Fix build on AIX X-Git-Tag: tevent-0.9.37~174 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edffe4d16514fa0c87655e040842f6c20d89791c;p=thirdparty%2Fsamba.git 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 --- diff --git a/lib/tdb/tools/tdbtool.c b/lib/tdb/tools/tdbtool.c index 3e9d154ae40..41ae52395b1 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); @@ -884,7 +884,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;