summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-04-11 22:17:24 +1000
committerAndrew Tridgell <tridge@samba.org>2007-04-11 22:17:24 +1000
commitd0be3abcf71ab3b51d98c0ed4548cb78bdefb9ba (patch)
tree84d79f214e4d8e34434c30ed9ff2e41638abb084
parent473ca4e3f7c35ccefc54852337778f5afe3949b3 (diff)
parent2597931dfdfa29d99cbf2b50b465fc85a41c29c8 (diff)
downloadsamba-d0be3abcf71ab3b51d98c0ed4548cb78bdefb9ba.tar.gz
samba-d0be3abcf71ab3b51d98c0ed4548cb78bdefb9ba.tar.xz
samba-d0be3abcf71ab3b51d98c0ed4548cb78bdefb9ba.zip
merge from volker
(This used to be ctdb commit 68bc5b4d0d2049ebcee19338f744efd5b129725a)
-rw-r--r--ctdb/common/ctdb_call.c8
-rw-r--r--ctdb/common/ctdb_daemon.c5
-rw-r--r--ctdb/direct/ctdbd.c15
3 files changed, 26 insertions, 2 deletions
diff --git a/ctdb/common/ctdb_call.c b/ctdb/common/ctdb_call.c
index f0fef64456..35ccc4bf0e 100644
--- a/ctdb/common/ctdb_call.c
+++ b/ctdb/common/ctdb_call.c
@@ -248,7 +248,9 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
}
}
if (!ctdb_db) {
- ctdb_send_error(ctdb, hdr, ret, "Unknown database in request. db_id==0x%08x",c->db_id);
+ ctdb_send_error(ctdb, hdr, -1,
+ "Unknown database in request. db_id==0x%08x",
+ c->db_id);
return;
}
@@ -315,7 +317,9 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
}
}
if (!ctdb_db) {
- ctdb_send_error(ctdb, hdr, ret, "Unknown database in request. db_id==0x%08x",c->db_id);
+ ctdb_send_error(ctdb, hdr, -1,
+ "Unknown database in request. db_id==0x%08x",
+ c->db_id);
return;
}
diff --git a/ctdb/common/ctdb_daemon.c b/ctdb/common/ctdb_daemon.c
index 6e9fbedb2f..72ab7ed0b1 100644
--- a/ctdb/common/ctdb_daemon.c
+++ b/ctdb/common/ctdb_daemon.c
@@ -283,6 +283,11 @@ static void ctdb_client_read_cb(uint8_t *data, size_t cnt, void *args)
struct ctdb_client *client = talloc_get_type(args, struct ctdb_client);
struct ctdb_req_header *hdr;
+ if (cnt == 0) {
+ talloc_free(client);
+ return;
+ }
+
if (cnt < sizeof(*hdr)) {
ctdb_set_error(client->ctdb, "Bad packet length %d\n", cnt);
return;
diff --git a/ctdb/direct/ctdbd.c b/ctdb/direct/ctdbd.c
index 8a99c0ab01..727ca1d4a6 100644
--- a/ctdb/direct/ctdbd.c
+++ b/ctdb/direct/ctdbd.c
@@ -22,6 +22,19 @@
#include "lib/events/events.h"
#include "system/filesys.h"
#include "popt.h"
+#include <signal.h>
+
+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);
+}
/*
@@ -75,6 +88,8 @@ int main(int argc, const char *argv[])
exit(1);
}
+ block_signal(SIGPIPE);
+
ev = event_context_init(NULL);
/* initialise ctdb */