diff options
author | Ronnie sahlberg <ronniesahlberg@gmail.com> | 2007-04-17 15:35:06 +1000 |
---|---|---|
committer | Ronnie sahlberg <ronniesahlberg@gmail.com> | 2007-04-17 15:35:06 +1000 |
commit | 6a2579cea919b7570e2c166260a097540cf98d2c (patch) | |
tree | 4634a3c1586c55c6967ca6d5f7e3bf667034d62d | |
parent | 67a9f54dabeeb0ec5d8de54e3c7c290cfe392901 (diff) | |
parent | ae6722e84568cda9b3dc494a3e7fd10bbeacdb8c (diff) | |
download | samba-6a2579cea919b7570e2c166260a097540cf98d2c.tar.gz samba-6a2579cea919b7570e2c166260a097540cf98d2c.tar.xz samba-6a2579cea919b7570e2c166260a097540cf98d2c.zip |
merge from tridge
(This used to be ctdb commit c4531b6de9189c3cd80862e29d2dd37aab36b9b4)
-rw-r--r-- | ctdb/common/ctdb_daemon.c | 15 | ||||
-rw-r--r-- | ctdb/common/ctdb_ltdb.c | 2 | ||||
-rw-r--r-- | ctdb/tests/ctdb_fetch.c | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/ctdb/common/ctdb_daemon.c b/ctdb/common/ctdb_daemon.c index 5a90003bc0..67653202af 100644 --- a/ctdb/common/ctdb_daemon.c +++ b/ctdb/common/ctdb_daemon.c @@ -25,6 +25,7 @@ #include "lib/util/dlinklist.h" #include "system/network.h" #include "system/filesys.h" +#include "system/wait.h" #include "../include/ctdb.h" #include "../include/ctdb_private.h" @@ -47,6 +48,18 @@ static void set_non_blocking(int fd) fcntl(fd, F_SETFL, v | O_NONBLOCK); } +static void block_signal(int signum) +{ + struct sigaction act; + + memset(&act, 0, sizeof(act)); + + act.sa_handler = SIG_IGN; + sigemptyset(&act.sa_mask); + sigaddset(&act.sa_mask, signum); + sigaction(signum, &act, NULL); +} + /* structure describing a connected client in the daemon @@ -558,6 +571,8 @@ int ctdb_start(struct ctdb_context *ctdb) return 0; } + block_signal(SIGPIPE); + /* ensure the socket is deleted on exit of the daemon */ domain_socket_name = talloc_strdup(talloc_autofree_context(), ctdb->daemon.name); talloc_set_destructor(domain_socket_name, unlink_destructor); diff --git a/ctdb/common/ctdb_ltdb.c b/ctdb/common/ctdb_ltdb.c index c523d5f995..e2aa47e4cd 100644 --- a/ctdb/common/ctdb_ltdb.c +++ b/ctdb/common/ctdb_ltdb.c @@ -85,7 +85,7 @@ struct ctdb_db_context *ctdb_attach(struct ctdb_context *ctdb, const char *name, /* when we have a separate daemon this will need to be a real file, not a TDB_INTERNAL, so the parent can access it to for ltdb bypass */ - ctdb_db->ltdb = tdb_wrap_open(ctdb, name, 0, TDB_INTERNAL, open_flags, mode); + ctdb_db->ltdb = tdb_wrap_open(ctdb, name, 0, TDB_DEFAULT, open_flags, mode); if (ctdb_db->ltdb == NULL) { ctdb_set_error(ctdb, "Failed to open tdb %s\n", name); talloc_free(ctdb_db); diff --git a/ctdb/tests/ctdb_fetch.c b/ctdb/tests/ctdb_fetch.c index 33396fe4f3..35ab989299 100644 --- a/ctdb/tests/ctdb_fetch.c +++ b/ctdb/tests/ctdb_fetch.c @@ -89,6 +89,7 @@ static void bench_fetch_1node(struct ctdb_context *ctdb) data.dsize = strlen((const char *)data.dptr)+1; ret = ctdb_record_store(h, data); + talloc_free(h); if (ret != 0) { printf("Failed to store record\n"); } |