]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-gatewayd: fix tmpfile logic 510/head
authorDaniel Mack <daniel@zonque.org>
Tue, 7 Jul 2015 21:21:03 +0000 (17:21 -0400)
committerDaniel Mack <daniel@zonque.org>
Tue, 7 Jul 2015 21:21:27 +0000 (17:21 -0400)
"rw" is not a valid mode string for f*open(). This got broken in
cc02a7b33049 ("journal-gatewayd: factor out opening of temp
file").

src/journal-remote/journal-gatewayd.c

index d9450ae8cdbe7fb2714271b6d47013d62b9ed6e1..9a09f401e09876b95db47a50d10a06ed7412c934 100644 (file)
@@ -132,7 +132,7 @@ static int request_meta_ensure_tmp(RequestMeta *m) {
                 if (fd < 0)
                         return fd;
 
-                m->tmp = fdopen(fd, "rw");
+                m->tmp = fdopen(fd, "w+");
                 if (!m->tmp) {
                         safe_close(fd);
                         return -errno;