diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-01-16 11:10:56 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-01-16 11:10:56 +0100 |
| commit | 02187686c26b3e08245a41636df7ee4da595906f (patch) | |
| tree | c7f9717da6ac34bbb325dfc36d414f3a97d61d20 | |
| parent | 931cf0ed8ebcfc9a1c43055873a31f3c1293d012 (diff) | |
| download | vis-02187686c26b3e08245a41636df7ee4da595906f.tar.gz vis-02187686c26b3e08245a41636df7ee4da595906f.tar.xz | |
Avoid possible double close when saving
We want close(2) to happen before rename(2).
At some point the save implementation will have to be overhauled.
| -rw-r--r-- | text.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -644,6 +644,7 @@ bool text_range_save(Text *txt, Filerange *range, const char *filename) { } if (close(fd) == -1) goto err; + fd = -1; if (rename(tmpname, filename) == -1) goto err; txt->saved_action = txt->undo; |
