[PATCH] dbwrap: Slightly simplify dbwrap_watch_record_stored

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Feb 25 05:08:17 MST 2014


Hi!

Review would be appreciated!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 9a60650991636bc52a29dabbea5c58b006ac650d Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Wed, 12 Feb 2014 12:48:19 +0000
Subject: [PATCH] dbwrap: Slightly simplify dbwrap_watch_record_stored

We have messaging_send_buf, so there's no point to use an explicit
DATA_BLOB here.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/lib/dbwrap/dbwrap_watch.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/source3/lib/dbwrap/dbwrap_watch.c b/source3/lib/dbwrap/dbwrap_watch.c
index ba4381e..4f3a2b3 100644
--- a/source3/lib/dbwrap/dbwrap_watch.c
+++ b/source3/lib/dbwrap/dbwrap_watch.c
@@ -307,7 +307,6 @@ static void dbwrap_watch_record_stored(struct db_context *db,
 	struct server_id *ids = NULL;
 	size_t num_ids = 0;
 	TDB_DATA w_key = { 0, };
-	DATA_BLOB w_blob;
 	NTSTATUS status;
 	uint32_t i;
 
@@ -326,12 +325,10 @@ static void dbwrap_watch_record_stored(struct db_context *db,
 		DEBUG(1, ("dbwrap_record_watchers_key failed\n"));
 		goto done;
 	}
-	w_blob.data = w_key.dptr;
-	w_blob.length = w_key.dsize;
 
 	for (i=0; i<num_ids; i++) {
-		status = messaging_send(msg, ids[i], MSG_DBWRAP_MODIFIED,
-					&w_blob);
+		status = messaging_send_buf(msg, ids[i], MSG_DBWRAP_MODIFIED,
+					    w_key.dptr, w_key.dsize);
 		if (!NT_STATUS_IS_OK(status)) {
 			char *str = procid_str_static(&ids[i]);
 			DEBUG(1, ("messaging_send to %s failed: %s\n",
-- 
1.8.1.2



More information about the samba-technical mailing list