[Dovecot] RE: build errors on cvs

Andrey Panin pazke at donpac.ru
Thu Oct 21 15:45:30 EEST 2004


On 295, 10 21, 2004 at 07:37:36AM -0500, Alex S Moore wrote:
> Building on Solaris 8 with Sun's compiler, I get the following error.
> Would you fix this?  Using gcc is not really a good option for me.
> 
> /opt/forte8/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -I. -I../..
> -I/opt/csw/inclu\de  -fast -xarch=v8 -I/opt/csw/include -c buffer.c
> "buffer.c", line 159: void function cannot return value
> "buffer.c", line 205: void function cannot return value
> cc: acomp failed for buffer.c
> *** Error code 2

Try the attached patch to fix this.

-- 
Andrey Panin		| Linux and UNIX system administrator
pazke at donpac.ru		| PGP key: wwwkeys.pgp.net
-------------- next part --------------
diff -urpN dovecot-1.0-test51.vanilla/src/lib/buffer.c dovecot-1.0-test51/src/lib/buffer.c
--- dovecot-1.0-test51.vanilla/src/lib/buffer.c	2004-10-08 21:47:42.000000000 +0400
+++ dovecot-1.0-test51/src/lib/buffer.c	2004-10-21 16:41:02.000000000 +0400
@@ -155,8 +155,10 @@ void buffer_insert(buffer_t *_buf, size_
 {
 	struct real_buffer *buf = (struct real_buffer *)_buf;
 
-	if (pos >= buf->used)
-		return buffer_write(_buf, pos, data, data_size);
+	if (pos >= buf->used) {
+		buffer_write(_buf, pos, data, data_size);
+		return;
+	}
 
 	buffer_copy(_buf, pos + data_size, _buf, pos, (size_t)-1);
 	memcpy(buf->w_buffer + pos, data, data_size);
@@ -201,8 +203,10 @@ void buffer_insert_zero(buffer_t *_buf, 
 {
 	struct real_buffer *buf = (struct real_buffer *)_buf;
 
-	if (pos >= buf->used)
-		return buffer_write_zero(_buf, pos, data_size);
+	if (pos >= buf->used) {
+		buffer_write_zero(_buf, pos, data_size);
+		return;
+	}
 
 	buffer_copy(_buf, pos + data_size, _buf, pos, (size_t)-1);
 	memset(buf->w_buffer + pos, 0, data_size);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://dovecot.org/pipermail/dovecot/attachments/20041021/826926f7/attachment-0001.bin>


More information about the dovecot mailing list