]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tdb: Fix build on AIX
authorAmitay Isaacs <amitay@gmail.com>
Fri, 29 Jun 2018 06:12:30 +0000 (16:12 +1000)
committerKarolin Seeger <kseeger@samba.org>
Tue, 10 Jul 2018 08:44:13 +0000 (10:44 +0200)
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 <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit edffe4d16514fa0c87655e040842f6c20d89791c)

lib/tdb/tools/tdbtool.c

index e3535b93c7c4296a9b4f9d3b9797841f762062cd..7a36ce2b71ab354e9dab9c15f84c85b0da8c041f 100644 (file)
@@ -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;