mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
merge from volker
(This used to be ctdb commit 68bc5b4d0d2049ebcee19338f744efd5b129725a)
This commit is contained in:
commit
d0be3abcf7
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user