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.
#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
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;
}