[pgcluster: 72] Re: packet.pg_data initialization and \n in elog()

Jun Kuriyama pgcluster@ml.postgresql.jp
Mon, 26 Jan 2004 17:52:34 +0900


--Multipart_Mon_Jan_26_17:52:34_2004-1
Content-Type: text/plain; charset=ISO-2022-JP

At Mon, 26 Jan 2004 17:23:05 +0900,
kuriyama wrote:
> $BI=<($,0l<0B7$&$N$,4r$7$$$@$1$+$b(B($BE:IU%Q%C%A$NA0H>(B)$B!#(B

$B!!E:IU$7$F$J$$$C$F$P!D!D!#(B


-- 
Jun Kuriyama <kuriyama@imgsrc.co.jp> // IMG SRC, Inc.
             <kuriyama@FreeBSD.org> // FreeBSD Project

--Multipart_Mon_Jan_26_17:52:34_2004-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="pgcluster-20040126.diff"
Content-Transfer-Encoding: 7bit

--- src/backend/libpq/recovery.c.orig	Mon Jan 26 16:42:56 2004
+++ src/backend/libpq/recovery.c	Mon Jan 26 17:05:24 2004
@@ -402,6 +402,7 @@
 	packet.port = PostPortNumber;
 	packet.recoveryPort = RecoveryPortNumber;
 	memcpy(packet.hostName,hostname,sizeof(packet.hostName));
+	memcpy(packet.pg_data,DataDir,sizeof(packet.pg_data));
 	
 	status = send_packet(sock,&packet);
 
@@ -434,6 +435,7 @@
 	packet.port = PostPortNumber;
 	packet.recoveryPort = RecoveryPortNumber;
 	memcpy(packet.hostName,hostname,sizeof(packet.hostName));
+	memcpy(packet.pg_data,DataDir,sizeof(packet.pg_data));
 	
 	status = send_packet(sock,&packet);
 	return status;
@@ -466,6 +468,7 @@
 	packet.port = PostPortNumber;
 	packet.recoveryPort = RecoveryPortNumber;
 	memcpy(packet.hostName,hostname,sizeof(packet.hostName));
+	memcpy(packet.pg_data,DataDir,sizeof(packet.pg_data));
 	status = send_packet(&fd,&packet);
 
 	close(fd);
@@ -756,14 +759,14 @@
 
 	if (Debug_pretty_print)
 	{
-		elog(DEBUG1,"no = %d\n",packet->packet_no);
-		elog(DEBUG1,"max_connect = %d\n",packet->max_connect);
-		elog(DEBUG1,"port = %d\n",packet->port);
-		elog(DEBUG1,"recoveryPort = %d\n",packet->recoveryPort);
+		elog(DEBUG1,"no = %d",packet->packet_no);
+		elog(DEBUG1,"max_connect = %d",packet->max_connect);
+		elog(DEBUG1,"port = %d",packet->port);
+		elog(DEBUG1,"recoveryPort = %d",packet->recoveryPort);
 		if (packet->hostName != NULL)
-			elog(DEBUG1,"hostName = %s\n",packet->hostName);
+			elog(DEBUG1,"hostName = %s",packet->hostName);
 		if (packet->pg_data != NULL)
-			elog(DEBUG1,"pg_data = %s\n",packet->pg_data);
+			elog(DEBUG1,"pg_data = %s",packet->pg_data);
 	}
 }
 

--Multipart_Mon_Jan_26_17:52:34_2004-1--