I'm such a fool
[apps/madmutt.git] / lib-lib / file.c
index 978895a..de3c75b 100644 (file)
@@ -506,7 +506,7 @@ int m_tempfd(char *dst, ssize_t n, const char *dir, const char *fmt)
         m_tempftplize(tpl, sizeof(tpl), fmt, raw);
     }
 
-    fd = open(path, O_CREAT | O_EXCL | O_WRONLY | O_NOFOLLOW, 0600);
+    fd = open(path, O_CREAT | O_EXCL | O_RDWR | O_NOFOLLOW, 0600);
 
     if (fd < 0) {
         if (errno == EEXIST)