X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/021e477322b745e0d01836e24fd4488378d82ebc..7f2b30d33c5898d31f9b6623657d93d272b8ea7a:/cookbooks/planet/files/default/flush/flush.c diff --git a/cookbooks/planet/files/default/flush/flush.c b/cookbooks/planet/files/default/flush/flush.c new file mode 100644 index 000000000..c80e86af2 --- /dev/null +++ b/cookbooks/planet/files/default/flush/flush.c @@ -0,0 +1,16 @@ +#include +#include + +static int (*real_close)(int fd); + +static void __attribute__((constructor)) initialise(void) +{ + real_close = dlsym(RTLD_NEXT, "close"); +} + +int close(int fd) +{ + fdatasync(fd); + + return real_close(fd); +}