From 205384d6a5ff3bab03e11e9e1324c18d16bb8192 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 28 Jan 2020 03:02:19 -0500 Subject: Call fopencookie with a+ This fixes strange behaviour when interleaving reads and writes. --- compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat.h b/compat.h index a3788dc..6398510 100644 --- a/compat.h +++ b/compat.h @@ -87,7 +87,7 @@ funopen( if (!funopen) return NULL; assert(!seekfn); *funopen = (struct _funopen) { (void *)cookie, readfn, writefn, closefn }; - return fopencookie(funopen, "r+", _cookie_fns); + return fopencookie(funopen, "a+", _cookie_fns); } #endif /* __linux__ */ -- cgit 1.4.1