summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-01-28 03:05:53 -0500
committerJune McEnroe <june@causal.agency>2020-01-28 03:05:53 -0500
commitd1533241f699359b7d171f12e4131a46a4c35935 (patch)
tree183d6b75bac226e3be086ab292ca20c0a3c94d4f
parentExit git-fetch-email on getopt failure (diff)
downloadimbox-d1533241f699359b7d171f12e4131a46a4c35935.tar.gz
imbox-d1533241f699359b7d171f12e4131a46a4c35935.zip
Call fopencookie with a+
Otherwise interleaved reads and writes can interfere with each other,
since you're supposed to have intervening fseeks.
-rw-r--r--compat.h2
1 files changed, 1 insertions, 1 deletions
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__ */