The branch, 2.5 has been updated
       via  8b61c049dbf21983ccfa7573429a48946ee0630d (commit)
       via  4a0ec35758098269012b108c37783f582397e197 (commit)
       via  fd30f14a548b3902f7783a9e19a383d523489363 (commit)
       via  ad682e05f5765530ec273df8df45cde6c523322a (commit)
       via  60140993c33e2202cabc59798b955bc7374b129a (commit)
       via  7425b9cdf2ddadbb51bbbe18669e5272b34568ea (commit)
       via  9f97865bc91c60a8744a99c668434bf105f8e971 (commit)
       via  1c44040d5d043c8f40dd22d5b94aac7f173706c5 (commit)
       via  e58ef9a9bc080e39bebea9e93abcd696fa29ea36 (commit)
       via  c8b4340b7d01fd8e17d3607470adbd7774bbe63b (commit)
       via  26fb6b3837297522034b8aa4734584294b8b49f2 (commit)
       via  95f19f402f180380e14967f75abebc4a8f30b7da (commit)
       via  585418fa418f65f39dcc1d8163acbbfa52a174e7 (commit)
       via  f97a858923ad0be43713dd8214595c43f3e3da4a (commit)
       via  817f4678e7e68b5a9663a1dda29fcb49339935d1 (commit)
       via  1dc1802607f0f6b0308a4abcbb4c85d318e99e39 (commit)
       via  6f07842d0d0c986cf1336f5cb1cc6eced741201c (commit)
       via  efd62609e7781acfb590245f028e96ba41fd7574 (commit)
       via  bd3b12765dd25dc35a6b0e0baf6d9e531329738f (commit)
       via  528488c29de6e5e9665ca1d73d060b7f50763b10 (commit)
      from  9381c33dfd40192b7532d942059c2959dfae059d (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=2.5


- Log -----------------------------------------------------------------
commit 8b61c049dbf21983ccfa7573429a48946ee0630d
Author: Amitay Isaacs <[email protected]>
Date:   Wed Nov 13 17:45:25 2013 +1100

    client: Treat empty __db_sequence_number__ record as 0
    
    This fixes the issue of transaction commit failing due to an empty
    __db_sequence_number__ record in persistent database left by previous
    cancelled transaction.
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit 4a0ec35758098269012b108c37783f582397e197
Author: Martin Schwenke <[email protected]>
Date:   Wed Nov 13 16:19:00 2013 +1100

    doc: Update ctdb.1 - primarily to add pdelete/pfetch/pstore/ptrans
    
    Also:
    
    * More <refentryinfo> above <refmeta> to make the XML valid.
    
    * Describe DB argument in introduction and use it for database
      commands.
    
    * Remove unnecessary format="linespecific" from <screen> tags, since
      it will not be allowed in DocBook 5.0.
    
    * Sort the items in "INTERNAL COMMANDS".
    
    * Update/simplify some command descriptions.
    
    Signed-off-by: Martin Schwenke <[email protected]>

commit fd30f14a548b3902f7783a9e19a383d523489363
Author: Martin Schwenke <[email protected]>
Date:   Wed Nov 6 13:43:53 2013 +1100

    tools/ctdb: New ptrans command
    
    Also add test.
    
    Signed-off-by: Martin Schwenke <[email protected]>
    Pair-programmed-with: Amitay Isaacs <[email protected]>

commit ad682e05f5765530ec273df8df45cde6c523322a
Author: Martin Schwenke <[email protected]>
Date:   Wed Nov 13 14:04:17 2013 +1100

    onnode: New -i option to stop stdin from being closed
    
    This can be useful for piping data to onnode in certain circumstances.
    
    There are now also enough command-line options that they should
    definitely be alphabetically ordered.
    
    Signed-off-by: Martin Schwenke <[email protected]>

commit 60140993c33e2202cabc59798b955bc7374b129a
Author: Martin Schwenke <[email protected]>
Date:   Wed Nov 13 14:13:52 2013 +1100

    tests/integration: try_command_on_node() shouldn't lose onnode options
    
    Currently it only passes the last (non -v) option seen.  It should
    pass them all.
    
    Signed-off-by: Martin Schwenke <[email protected]>

commit 7425b9cdf2ddadbb51bbbe18669e5272b34568ea
Author: Martin Schwenke <[email protected]>
Date:   Tue Nov 12 15:16:49 2013 +1100

    recoverd: Fix backward compatibility for CTDB_SRVID_TAKEOVER_RUN
    
    When running a mixed version cluster, compatibility with older
    versions was was broken during recent refactorisation.
    
    Signed-off-by: Martin Schwenke <[email protected]>
    Pair-programmed-with: Amitay Isaacs <[email protected]>

commit 9f97865bc91c60a8744a99c668434bf105f8e971
Author: Martin Schwenke <[email protected]>
Date:   Mon Nov 4 12:56:39 2013 +1100

    scripts: debug_locks.sh should use configuration to find TDB location
    
    That is, don't use fixed paths.
    
    Signed-off-by: Martin Schwenke <[email protected]>
    Pair-programmed-with: Amitay Isaacs <[email protected]>

commit 1c44040d5d043c8f40dd22d5b94aac7f173706c5
Author: Martin Schwenke <[email protected]>
Date:   Fri Nov 1 14:34:20 2013 +1100

    recoverd: A node refuses to play against itself
    
    Signed-off-by: Martin Schwenke <[email protected]>
    Pair-programmed-with: Amitay Isaacs <[email protected]>

commit e58ef9a9bc080e39bebea9e93abcd696fa29ea36
Author: Martin Schwenke <[email protected]>
Date:   Thu Nov 14 14:25:47 2013 +1100

    recoverd: Remove duplicate code to update flags during recovery
    
    This also happens earlier in do_recovery() and the nodemap is not
    updated after that, so this update is redundant.
    
    Signed-off-by: Martin Schwenke <[email protected]>

commit c8b4340b7d01fd8e17d3607470adbd7774bbe63b
Author: Martin Schwenke <[email protected]>
Date:   Thu Nov 14 14:14:10 2013 +1100

    build: Update to latest upstream config.guess
    
    Signed-off-by: Martin Schwenke <[email protected]>

commit 26fb6b3837297522034b8aa4734584294b8b49f2
Author: Amitay Isaacs <[email protected]>
Date:   Wed Nov 13 15:25:46 2013 +1100

    tools/ctdb: Fix db commands when dbid is given instead of name
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit 95f19f402f180380e14967f75abebc4a8f30b7da
Author: Amitay Isaacs <[email protected]>
Date:   Wed Nov 13 14:33:31 2013 +1100

    tests: CTDB tool should always be invoked as $CTDB instad of ctdb
    
    $CTDB_TEST_WRAPPER is required only to run test functions or test binaries
    on remote nodes.  For running ctdb command, $CTDB is sufficient.
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit 585418fa418f65f39dcc1d8163acbbfa52a174e7
Author: Amitay Isaacs <[email protected]>
Date:   Wed Nov 13 14:25:59 2013 +1100

    tests: No need to run onnode in parallel for single node
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit f97a858923ad0be43713dd8214595c43f3e3da4a
Author: Amitay Isaacs <[email protected]>
Date:   Wed Nov 13 14:19:43 2013 +1100

    tests: Remove -q option to try_command_on_node
    
    This option is always passed to onnode by default.
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit 817f4678e7e68b5a9663a1dda29fcb49339935d1
Author: Amitay Isaacs <[email protected]>
Date:   Mon Nov 11 12:41:17 2013 +1100

    tests: Coverity fixes
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit 1dc1802607f0f6b0308a4abcbb4c85d318e99e39
Author: Amitay Isaacs <[email protected]>
Date:   Mon Nov 11 12:41:00 2013 +1100

    tcp: Coverity fixes
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit 6f07842d0d0c986cf1336f5cb1cc6eced741201c
Author: Amitay Isaacs <[email protected]>
Date:   Mon Nov 11 12:40:44 2013 +1100

    tools/ctdb: Coverity fixes
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit efd62609e7781acfb590245f028e96ba41fd7574
Author: Amitay Isaacs <[email protected]>
Date:   Mon Nov 11 12:40:28 2013 +1100

    common: Coverity fixes
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit bd3b12765dd25dc35a6b0e0baf6d9e531329738f
Author: Amitay Isaacs <[email protected]>
Date:   Mon Nov 11 12:39:48 2013 +1100

    client: Coverity fixes
    
    Signed-off-by: Amitay Isaacs <[email protected]>

commit 528488c29de6e5e9665ca1d73d060b7f50763b10
Author: Amitay Isaacs <[email protected]>
Date:   Mon Nov 11 12:39:27 2013 +1100

    server: Coverity fixes
    
    Signed-off-by: Amitay Isaacs <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 client/ctdb_client.c                         |   10 +-
 common/ctdb_ltdb.c                           |    5 +-
 common/ctdb_util.c                           |   28 ++-
 common/system_linux.c                        |   20 +-
 config.guess                                 |  149 +++++++-----
 config/debug_locks.sh                        |   12 +-
 doc/ctdb.1.xml                               |  324 ++++++++++++++++----------
 doc/onnode.1.xml                             |   12 +
 include/ctdb_client.h                        |    1 +
 include/ctdb_private.h                       |    7 +-
 server/ctdb_banning.c                        |    2 +-
 server/ctdb_control.c                        |    6 +
 server/ctdb_daemon.c                         |    2 +-
 server/ctdb_lock.c                           |   11 +-
 server/ctdb_logging.c                        |    8 +-
 server/ctdb_recover.c                        |    6 +-
 server/ctdb_recoverd.c                       |   72 +++---
 server/ctdb_takeover.c                       |    2 +-
 tcp/tcp_connect.c                            |   32 ++-
 tests/scripts/integration.bash               |    2 +-
 tests/simple/51_ctdb_bench.sh                |    2 +-
 tests/simple/52_ctdb_fetch.sh                |    2 +-
 tests/simple/53_ctdb_transaction.sh          |    2 +-
 tests/simple/54_ctdb_transaction_recovery.sh |    2 +-
 tests/simple/55_ctdb_ptrans.sh               |  127 ++++++++++
 tests/simple/70_recoverpdbbyseqnum.sh        |   84 ++++----
 tests/simple/71_ctdb_wipedb.sh               |   16 +-
 tests/simple/72_update_record_persistent.sh  |   20 +-
 tests/simple/73_tunable_NoIPTakeover.sh      |   16 +-
 tests/simple/75_readonly_records_basic.sh    |   28 ++--
 tests/simple/76_ctdb_pdb_recovery.sh         |   26 +-
 tests/simple/77_ctdb_db_recovery.sh          |   26 +-
 tests/simple/80_ctdb_traverse.sh             |    8 +-
 tests/src/ctdb_porting_tests.c               |   22 ++-
 tools/ctdb.c                                 |  270 ++++++++++++++++++----
 tools/onnode                                 |   15 +-
 36 files changed, 931 insertions(+), 446 deletions(-)
 mode change 100644 => 100755 config/debug_locks.sh
 create mode 100755 tests/simple/55_ctdb_ptrans.sh


Changeset truncated at 500 lines:

diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index fddbd02..885dbfd 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -253,7 +253,7 @@ int ctdb_socket_connect(struct ctdb_context *ctdb)
 
        memset(&addr, 0, sizeof(addr));
        addr.sun_family = AF_UNIX;
-       strncpy(addr.sun_path, ctdb->daemon.name, sizeof(addr.sun_path));
+       strncpy(addr.sun_path, ctdb->daemon.name, sizeof(addr.sun_path)-1);
 
        ctdb->daemon.sd = socket(AF_UNIX, SOCK_STREAM, 0);
        if (ctdb->daemon.sd == -1) {
@@ -3444,6 +3444,9 @@ static void async_callback(struct 
ctdb_client_control_state *state)
        int32_t res = -1;
        uint32_t destnode = state->c->hdr.destnode;
 
+       outdata.dsize = 0;
+       outdata.dptr = NULL;
+
        /* one more node has responded with recmode data */
        data->count--;
 
@@ -4183,6 +4186,11 @@ static int ctdb_fetch_db_seqnum(struct ctdb_db_context 
*ctdb_db, uint64_t *seqnu
                return 0;
        }
 
+       if (data.dsize == 0) {
+               *seqnum = 0;
+               return 0;
+       }
+
        if (data.dsize != sizeof(*seqnum)) {
                DEBUG(DEBUG_ERR, (__location__ " Invalid data recived 
len=%zi\n",
                                  data.dsize));
diff --git a/common/ctdb_ltdb.c b/common/ctdb_ltdb.c
index 4681f30..500f721 100644
--- a/common/ctdb_ltdb.c
+++ b/common/ctdb_ltdb.c
@@ -98,7 +98,10 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
                        *data = d2;
                }
                if (ctdb_db->persistent || header->dmaster == 
ctdb_db->ctdb->pnn) {
-                       ctdb_ltdb_store(ctdb_db, key, header, d2);
+                       if (ctdb_ltdb_store(ctdb_db, key, header, d2) != 0) {
+                               DEBUG(DEBUG_NOTICE,
+                                     (__location__ "failed to store initial 
header\n"));
+                       }
                }
                return 0;
        }
diff --git a/common/ctdb_util.c b/common/ctdb_util.c
index 7a70fea..44eb0db 100644
--- a/common/ctdb_util.c
+++ b/common/ctdb_util.c
@@ -415,16 +415,34 @@ void ctdb_restore_scheduler(struct ctdb_context *ctdb)
 
 void set_nonblocking(int fd)
 {
-       unsigned v;
+       int v;
+
        v = fcntl(fd, F_GETFL, 0);
-        fcntl(fd, F_SETFL, v | O_NONBLOCK);
+       if (v == -1) {
+               DEBUG(DEBUG_WARNING, ("Failed to get file status flags - %s\n",
+                                     strerror(errno)));
+               return;
+       }
+        if (fcntl(fd, F_SETFL, v | O_NONBLOCK) == -1) {
+               DEBUG(DEBUG_WARNING, ("Failed to set non_blocking on fd - %s\n",
+                                     strerror(errno)));
+       }
 }
 
 void set_close_on_exec(int fd)
 {
-       unsigned v;
+       int v;
+
        v = fcntl(fd, F_GETFD, 0);
-       fcntl(fd, F_SETFD, v | FD_CLOEXEC);
+       if (v == -1) {
+               DEBUG(DEBUG_WARNING, ("Failed to get file descriptor flags - 
%s\n",
+                                     strerror(errno)));
+               return;
+       }
+       if (fcntl(fd, F_SETFD, v | FD_CLOEXEC) != 0) {
+               DEBUG(DEBUG_WARNING, ("Failed to set close_on_exec on fd - 
%s\n",
+                                     strerror(errno)));
+       }
 }
 
 
@@ -821,7 +839,7 @@ void ctdb_mkdir_p_or_die(struct ctdb_context *ctdb, const 
char *dir, int mode)
                DEBUG(DEBUG_ALERT,
                      ("ctdb exiting with error: "
                       "failed to create directory \"%s\" (%s)\n",
-                      dir, strerror(ret)));
+                      dir, strerror(errno)));
                exit(1);
        }
 }
diff --git a/common/system_linux.c b/common/system_linux.c
index 84daba4..9aaa1fd 100644
--- a/common/system_linux.c
+++ b/common/system_linux.c
@@ -83,6 +83,8 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char 
*iface)
        struct ifreq ifr;
 
        ZERO_STRUCT(sall);
+       ZERO_STRUCT(ifr);
+       ZERO_STRUCT(if_hwaddr);
 
        switch (addr->ip.sin_family) {
        case AF_INET:
@@ -93,7 +95,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char 
*iface)
                }
 
                DEBUG(DEBUG_DEBUG, (__location__ " Created SOCKET FD:%d for 
sending arp\n", s));
-               strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
+               strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1);
                if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
                        DEBUG(DEBUG_CRIT,(__location__ " interface '%s' not 
found\n", iface));
                        close(s);
@@ -101,7 +103,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const 
char *iface)
                }
 
                /* get the mac address */
-               strcpy(if_hwaddr.ifr_name, iface);
+               strncpy(if_hwaddr.ifr_name, iface, 
sizeof(if_hwaddr.ifr_name)-1);
                ret = ioctl(s, SIOCGIFHWADDR, &if_hwaddr);
                if ( ret < 0 ) {
                        close(s);
@@ -195,7 +197,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const 
char *iface)
                }
 
                /* get the mac address */
-               strcpy(if_hwaddr.ifr_name, iface);
+               strncpy(if_hwaddr.ifr_name, iface, 
sizeof(if_hwaddr.ifr_name)-1);
                ret = ioctl(s, SIOCGIFHWADDR, &if_hwaddr);
                if ( ret < 0 ) {
                        close(s);
@@ -554,7 +556,7 @@ bool ctdb_sys_check_iface_exists(const char *iface)
                return true;
        }
 
-       strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
+       strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1);
        if (ioctl(s, SIOCGIFINDEX, &ifr) < 0 && errno == ENODEV) {
                DEBUG(DEBUG_CRIT,(__location__ " interface '%s' not found\n", 
iface));
                close(s);
@@ -587,7 +589,7 @@ char *ctdb_get_process_name(pid_t pid)
        int n;
 
        snprintf(path, sizeof(path), "/proc/%d/exe", pid);
-       n = readlink(path, buf, sizeof(buf));
+       n = readlink(path, buf, sizeof(buf)-1);
        if (n < 0) {
                return NULL;
        }
@@ -595,7 +597,7 @@ char *ctdb_get_process_name(pid_t pid)
        /* Remove any extra fields */
        buf[n] = '\0';
        ptr = strtok(buf, " ");
-       return strdup(ptr);
+       return (ptr == NULL ? ptr : strdup(ptr));
 }
 
 /*
@@ -701,14 +703,13 @@ bool ctdb_get_lock_info(pid_t req_pid, struct 
ctdb_lock_info *lock_info)
        struct ctdb_lock_info curlock;
        pid_t pid;
        char buf[1024];
-       char *ptr;
        bool status = false;
 
        if ((fp = fopen("/proc/locks", "r")) == NULL) {
                DEBUG(DEBUG_ERR, ("Failed to read locks information"));
                return false;
        }
-       while ((ptr = fgets(buf, sizeof(buf), fp)) != NULL) {
+       while (fgets(buf, sizeof(buf), fp) != NULL) {
                if (! parse_proc_locks_line(buf, &pid, &curlock)) {
                        continue;
                }
@@ -733,14 +734,13 @@ bool ctdb_get_blocker_pid(struct ctdb_lock_info *reqlock, 
pid_t *blocker_pid)
        struct ctdb_lock_info curlock;
        pid_t pid;
        char buf[1024];
-       char *ptr;
        bool status = false;
 
        if ((fp = fopen("/proc/locks", "r")) == NULL) {
                DEBUG(DEBUG_ERR, ("Failed to read locks information"));
                return false;
        }
-       while ((ptr = fgets(buf, sizeof(buf), fp)) != NULL) {
+       while (fgets(buf, sizeof(buf), fp) != NULL) {
                if (! parse_proc_locks_line(buf, &pid, &curlock)) {
                        continue;
                }
diff --git a/config.guess b/config.guess
index 0aee604..b79252d 100644
--- a/config.guess
+++ b/config.guess
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-30'
+timestamp='2013-06-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -52,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -136,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || 
UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+       # If the system lacks a compiler, then just pick glibc.
+       # We could probably try harder.
+       LIBC=gnu
+
+       eval $set_cc_for_build
+       cat <<-EOF > $dummy.c
+       #include <features.h>
+       #if defined(__UCLIBC__)
+       LIBC=uclibc
+       #elif defined(__dietlibc__)
+       LIBC=dietlibc
+       #else
+       LIBC=gnu
+       #endif
+       EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       ;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -857,21 +874,21 @@ EOF
        exit ;;
     *:GNU:*:*)
        # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo 
${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo 
${UNAME_RELEASE}|sed -e 's,/.*$,,'`
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' 
| tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' 
| tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
        exit ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
     aarch64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     aarch64_be:Linux:*:*)
        UNAME_MACHINE=aarch64_be
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -884,59 +901,54 @@ EOF
          EV68*) UNAME_MACHINE=alphaev68 ;;
        esac
        objdump --private-headers /bin/sh | grep -q ld.so.1
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     arm*:Linux:*:*)
        eval $set_cc_for_build
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_EABI__
        then
-           echo ${UNAME_MACHINE}-unknown-linux-gnu
+           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        else
            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
                | grep -q __ARM_PCS_VFP
            then
-               echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
            else
-               echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
            fi
        fi
        exit ;;
     avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     cris:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
        exit ;;
     crisv32:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
        exit ;;
     frv:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     hexagon:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     i*86:Linux:*:*)
-       LIBC=gnu
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #ifdef __dietlibc__
-       LIBC=dietlibc
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
        eval $set_cc_for_build
@@ -955,54 +967,63 @@ EOF
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
        ;;
+    or1k:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     or32:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     padre:Linux:*:*)
-       echo sparc-unknown-linux-gnu
+       echo sparc-unknown-linux-${LIBC}
        exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
+       echo hppa64-unknown-linux-${LIBC}
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
+         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+         *)    echo hppa-unknown-linux-${LIBC} ;;
        esac
        exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
+       echo powerpc64-unknown-linux-${LIBC}
        exit ;;
     ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
+       echo powerpc-unknown-linux-${LIBC}
+       exit ;;
+    ppc64le:Linux:*:*)
+       echo powerpc64le-unknown-linux-${LIBC}
+       exit ;;
+    ppcle:Linux:*:*)
+       echo powerpcle-unknown-linux-${LIBC}
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux
+       echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     tile*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-gnu
+       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
        exit ;;
     x86_64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
        exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1235,19 +1256,21 @@ EOF
        exit ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       case $UNAME_PROCESSOR in
-           i386)
-               eval $set_cc_for_build
-               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo 
'#endif') | \
-                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-                     grep IS_64BIT_ARCH >/dev/null
-                 then
-                     UNAME_PROCESSOR="x86_64"
-                 fi
-               fi ;;
-           unknown) UNAME_PROCESSOR=powerpc ;;
-       esac
+       eval $set_cc_for_build
+       if test "$UNAME_PROCESSOR" = unknown ; then
+           UNAME_PROCESSOR=powerpc
+       fi
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               case $UNAME_PROCESSOR in
+                   i386) UNAME_PROCESSOR=x86_64 ;;
+                   powerpc) UNAME_PROCESSOR=powerpc64 ;;
+               esac
+           fi
+       fi
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
        exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
diff --git a/config/debug_locks.sh b/config/debug_locks.sh
old mode 100644
new mode 100755
index 0dde861..ce80835
--- a/config/debug_locks.sh
+++ b/config/debug_locks.sh
@@ -7,9 +7,17 @@
 # This script can be used only if Samba is configured to use fcntl locks
 # rather than mutex locks.
 
+[ -n "$CTDB_BASE" ] || \
+    export CTDB_BASE=$(cd -P $(dirname "$0") ; echo "$PWD")
+
+. "$CTDB_BASE/functions"
+
+loadconfig ctdb
+
 # Create sed expression to convert inodes to names
-sed_cmd=$( ls -li /var/ctdb/*.tdb.* /var/ctdb/persistent/*.tdb.* |
-          sed -e "s#/var/ctdb[/persistent]*/\(.*\)#\1#" |
+sed_cmd=$( ls -li "$CTDB_DBDIR"/*.tdb.* "$CTDB_DBDIR_PERSISTENT"/*.tdb.* |
+          sed -e "s#${CTDB_DBDIR}/\(.*\)#\1#" \
+              -e "s#${CTDB_DBDIR_PERSISTENT}/\(.*\)#\1#" |


-- 
CTDB repository

Reply via email to