From d1533241f699359b7d171f12e4131a46a4c35935 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 28 Jan 2020 03:05:53 -0500 Subject: Call fopencookie with a+ Otherwise interleaved reads and writes can interfere with each other, since you're supposed to have intervening fseeks. --- compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat.h b/compat.h index 55dda53..8110e24 100644 --- a/compat.h +++ b/compat.h @@ -84,7 +84,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