[dovecot-cvs] dovecot/src/imap rawlog.c,1.1,1.2

cras at procontrol.fi cras at procontrol.fi
Wed Nov 6 15:06:58 EET 2002


Update of /home/cvs/dovecot/src/imap
In directory danu:/tmp/cvs-serv9316

Modified Files:
	rawlog.c 
Log Message:
A bit kludgy bugfix to prevent rawlog from hanging.



Index: rawlog.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/rawlog.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- rawlog.c	29 Oct 2002 06:29:17 -0000	1.1
+++ rawlog.c	6 Nov 2002 13:06:56 -0000	1.2
@@ -5,6 +5,7 @@
 #ifdef BUILD_RAWLOG
 
 #include "ioloop.h"
+#include "network.h"
 #include "rawlog.h"
 #include "write-full.h"
 
@@ -23,6 +24,7 @@
 	char buf[1024];
 	ssize_t r_ret, s_ret;
 
+	net_set_nonblock(in, TRUE);
 	r_ret = read(in, buf, sizeof(buf));
 	if (r_ret <= 0) {
 		if (r_ret < 0)
@@ -36,6 +38,7 @@
 	if (write_full(log, buf, r_ret) < 0)
 		i_fatal("Can't write to log file: %m");
 
+	net_set_nonblock(out, FALSE);
 	do {
 		s_ret = write(out, buf, r_ret);
 		if (s_ret <= 0) {




More information about the dovecot-cvs mailing list