[dovecot-cvs] dovecot/src/lib istream-file.c,1.7,1.8

cras at procontrol.fi cras at procontrol.fi
Sat Feb 8 14:38:20 EET 2003


Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv4499

Modified Files:
	istream-file.c 
Log Message:
use the file size only for regular files. FreeBSD gave sockets a size of 4
which broke things.



Index: istream-file.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/istream-file.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- istream-file.c	11 Jan 2003 19:55:56 -0000	1.7
+++ istream-file.c	8 Feb 2003 12:38:18 -0000	1.8
@@ -291,9 +291,9 @@
 	fstream->istream.seek = _seek;
 
 	/* get size of fd if it's a file */
-	if (fstat(fd, &st) < 0)
+	if (fstat(fd, &st) < 0 || !S_ISREG(st.st_mode))
 		st.st_size = 0;
-	else if (S_ISREG(st.st_mode))
+	else
 		fstream->file = TRUE;
 
 	return _i_stream_create(&fstream->istream, pool, fd, 0,




More information about the dovecot-cvs mailing list