diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-10-25 14:27:10 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-10-25 15:32:49 +0200 |
| commit | d19c7962600cde319ede932f162e24bf8391d65c (patch) | |
| tree | cc12185e8ca4574f05d5fca8a0b47dd2425bb27f /text.c | |
| parent | ecce157aeb21226266e718472e610d9a0a696fd4 (diff) | |
| download | vis-d19c7962600cde319ede932f162e24bf8391d65c.tar.gz vis-d19c7962600cde319ede932f162e24bf8391d65c.tar.xz | |
Change return type of text_save
Diffstat (limited to 'text.c')
| -rw-r--r-- | text.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -598,12 +598,12 @@ size_t text_redo(Text *txt) { * and then atomically moved to its final (possibly alredy existing) destination * using rename(2). */ -int text_save(Text *txt, const char *filename) { +bool text_save(Text *txt, const char *filename) { int fd = -1; size_t len = strlen(filename) + 10; char *tmpname = malloc(len); if (!tmpname) - return -1; + return false; snprintf(tmpname, len, "%s~", filename); // TODO preserve user/group struct stat meta; @@ -642,12 +642,12 @@ int text_save(Text *txt, const char *filename) { if (!txt->filename) text_filename_set(txt, filename); free(tmpname); - return 0; + return true; err: if (fd != -1) close(fd); free(tmpname); - return -1; + return false; } ssize_t text_write(Text *txt, int fd) { |
