[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/group/daemon main.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL50
Changes by:	teigland sourceware org	2006-12-01 15:25:30

Modified files:
	group/daemon   : main.c 

Log message:
	group_tool dump doesn't handle partial reads/writes,
	now we always dump entire fixed size debug buffer
	bz 214540

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/main.c.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.51.4.3&r2=1.51.4.4

--- cluster/group/daemon/main.c	2006/11/20 22:44:31	1.51.4.3
+++ cluster/group/daemon/main.c	2006/12/01 15:25:30	1.51.4.4
@@ -551,25 +551,24 @@
 
 static int do_dump(int fd)
 {
-	int rv, len;
+	int rv, len = DUMP_SIZE;
 
 	if (dump_wrap) {
 		len = DUMP_SIZE - dump_point;
-		rv = write(fd, dump_buf + dump_point, len);
-		if (rv != len)
-			log_print("write error %d errno %d", rv, errno);
-	}
-	len = dump_point;
-
-	rv = write(fd, dump_buf, len);
-	if (rv != len)
-		log_print("write error %d errno %d", rv, errno);
+		rv = do_write(fd, dump_buf + dump_point, len);
+		if (rv < 0)
+			log_print("dump write error %d errno %d", rv, errno);
+		len = dump_point;
+	}
+
+	rv = do_write(fd, dump_buf, len);
+	if (rv < 0)
+		log_print("dump write error %d errno %d", rv, errno);
 	return 0;
 }
 
 static int do_log(int fd, const char *comment)
 {
-
 	log_print("%s", comment);
 	return 0;
 }
@@ -673,7 +672,7 @@
 		break;
 
 	default:
-		log_print("unknown action %d client %d bytes %d", act, ci, rv);
+		log_print("unknown action %d client %d", act, ci);
 		log_print("invalid message: \"%s\"", buf);
 	}
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]