[PATCH] Minor messaging cleanups

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Sep 30 00:14:16 UTC 2015


Hi!

Review&push 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 1892d3c81f643a1f825cab0b9dbf3c896f5b6cac Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Wed, 30 Sep 2015 00:30:28 +0200
Subject: [PATCH 1/2] messages_dgm: No includes.h necessary

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

diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index 1602caf..79b2ce7 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -17,7 +17,10 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "includes.h"
+#include "replace.h"
+#include "system/network.h"
+#include "system/filesys.h"
+#include <dirent.h>
 #include "lib/util/data_blob.h"
 #include "lib/util/debug.h"
 #include "lib/unix_msg/unix_msg.h"
@@ -66,7 +69,7 @@ static int messaging_dgm_lockfile_create(struct messaging_dgm_context *ctx,
 					 pid_t pid, int *plockfile_fd,
 					 uint64_t unique)
 {
-	fstring buf;
+	char buf[64];
 	int lockfile_fd;
 	struct sun_path_buf lockfile_name;
 	struct flock lck;
-- 
1.9.1


From 746a13078efcef0339d92db3a22e873e52b38689 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Wed, 30 Sep 2015 00:30:49 +0200
Subject: [PATCH 2/2] messages_dgm: Fix an incorrect cast

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/lib/messages_dgm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index 79b2ce7..944602a 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -77,7 +77,7 @@ static int messaging_dgm_lockfile_create(struct messaging_dgm_context *ctx,
 	ssize_t written;
 
 	ret = snprintf(lockfile_name.buf, sizeof(lockfile_name.buf),
-		       "%s/%u", ctx->lockfile_dir.buf, (int)pid);
+		       "%s/%u", ctx->lockfile_dir.buf, (unsigned)pid);
 	if (ret >= sizeof(lockfile_name.buf)) {
 		return ENAMETOOLONG;
 	}
-- 
1.9.1



More information about the samba-technical mailing list