]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: a couple of trivial sparse cleanups
authorPhil Carmody <phil@dovecot.fi>
Wed, 7 May 2014 13:52:22 +0000 (16:52 +0300)
committerPhil Carmody <phil@dovecot.fi>
Wed, 7 May 2014 13:52:22 +0000 (16:52 +0300)
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.

src/lib/file-set-size.c
src/lib/istream.c

index e153bc5cd31126edec362c7f2a2f1f74cf8a15e2..14e09089cb7215c2011f0149336cbb990e5552a6 100644 (file)
@@ -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
 
index 3c3e181595dd2f14519cebdd10365e38c393419d..c4b2c698a636c29c042ced503ea220c8b0106200 100644 (file)
@@ -77,7 +77,7 @@ void i_stream_remove_destroy_callback(struct istream *stream,
 
        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;
                }