dovecot-2.2: lib: a couple of trivial sparse cleanups

dovecot at dovecot.org dovecot at dovecot.org
Thu May 8 11:16:01 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/3d7b9a927656
changeset: 17353:3d7b9a927656
user:      Phil Carmody <phil at dovecot.fi>
date:      Wed May 07 16:52:22 2014 +0300
description:
lib: a couple of trivial sparse cleanups

The #include isn't needed on modern linux, as the macros are already defined
The compiler seems to silently ignore redefinitions in system header files,
so didn't throw a warning, but probably should have, as redefinitions can lead
to insanity.

The cast just makes it explicit that we're changing the prototype.

diffstat:

 src/lib/file-set-size.c |  3 ++-
 src/lib/istream.c       |  2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r d7a66090b7c7 -r 3d7b9a927656 src/lib/file-set-size.c
--- a/src/lib/file-set-size.c	Thu May 08 14:11:46 2014 +0300
+++ b/src/lib/file-set-size.c	Wed May 07 16:52:22 2014 +0300
@@ -14,7 +14,8 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-#ifdef HAVE_LINUX_FALLOC_H
+#if defined(HAVE_LINUX_FALLOC_H) && !defined(FALLOC_FL_KEEP_SIZE)
+/* Legacy Linux does not have the FALLOC_FL_* flags under fcntl.h */
 #  include <linux/falloc.h>
 #endif
 
diff -r d7a66090b7c7 -r 3d7b9a927656 src/lib/istream.c
--- a/src/lib/istream.c	Thu May 08 14:11:46 2014 +0300
+++ b/src/lib/istream.c	Wed May 07 16:52:22 2014 +0300
@@ -77,7 +77,7 @@
 
 	dcs = array_get(&iostream->destroy_callbacks, &count);
 	for (i = 0; i < count; i++) {
-		if (dcs[i].callback == callback) {
+		if (dcs[i].callback == (istream_callback_t *)callback) {
 			array_delete(&iostream->destroy_callbacks, i, 1);
 			return;
 		}


More information about the dovecot-cvs mailing list