Rev 95: merge from volker in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Wed Apr 11 12:17:24 GMT 2007


------------------------------------------------------------
revno: 95
revision-id: tridge at samba.org-20070411121724-5e763a4a0a3fc6ac
parent: tridge at samba.org-20070411121107-b9d7c18f685f344f
parent: vl at samba.org-20070411115758-oua7f39sry0tw1z9
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Wed 2007-04-11 22:17:24 +1000
message:
  merge from volker
modified:
  common/ctdb_call.c             ctdb_call.c-20061128065342-to93h6eejj5kon81-1
  common/ctdb_daemon.c           ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
  direct/ctdbd.c                 ctdbd.c-20070411085044-dqmhr6mfeexnyt4m-1
    ------------------------------------------------------------
    merged: vl at samba.org-20070411115758-oua7f39sry0tw1z9
    parent: ronniesahlberg at gmail.com-20070411103224-hvqzewjcfhpxcgbg
    parent: vl at samba.org-20070411111736-rllo7o2u3tnzq0pg
    committer: Volker Lendecke <vl at samba.org>
    branch nick: ctdb-vl
    timestamp: Wed 2007-04-11 13:57:58 +0200
    message:
      merge
    ------------------------------------------------------------
    merged: vl at samba.org-20070411111736-rllo7o2u3tnzq0pg
    parent: vl at samba.org-20070411104910-78d551d2qsfxpytz
    committer: Volker Lendecke <vl at samba.org>
    branch nick: ctdb
    timestamp: Wed 2007-04-11 13:17:36 +0200
    message:
      Handle a client that exited correctly: We need to ignore SIGPIPE and when the
      read returns 0 bytes this means the client has exited. Close the connection
      then.
    ------------------------------------------------------------
    merged: vl at samba.org-20070411104910-78d551d2qsfxpytz
    parent: ronniesahlberg at gmail.com-20070411103224-hvqzewjcfhpxcgbg
    committer: Volker Lendecke <vl at samba.org>
    branch nick: ctdb
    timestamp: Wed 2007-04-11 12:49:10 +0200
    message:
      Fix uninitialized variable warnings
=== modified file 'common/ctdb_call.c'
--- a/common/ctdb_call.c	2007-04-11 01:58:28 +0000
+++ b/common/ctdb_call.c	2007-04-11 10:49:10 +0000
@@ -248,7 +248,9 @@
 		}
 	}
 	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 @@
 		}
 	}
 	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;
 	}
 

=== modified file 'common/ctdb_daemon.c'
--- a/common/ctdb_daemon.c	2007-04-11 09:04:09 +0000
+++ b/common/ctdb_daemon.c	2007-04-11 11:17:36 +0000
@@ -283,6 +283,11 @@
 	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;

=== modified file 'direct/ctdbd.c'
--- a/direct/ctdbd.c	2007-04-11 08:54:22 +0000
+++ b/direct/ctdbd.c	2007-04-11 11:17:36 +0000
@@ -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 @@
 		exit(1);
 	}
 
+	block_signal(SIGPIPE);
+
 	ev = event_context_init(NULL);
 
 	/* initialise ctdb */



More information about the samba-cvs mailing list