]> git.cworth.org Git - notmuch/commit
show: Handle read and write errors
authorAustin Clements <amdragon@MIT.EDU>
Thu, 19 Jan 2012 22:29:18 +0000 (17:29 -0500)
committerDavid Bremner <bremner@debian.org>
Sat, 21 Jan 2012 12:47:08 +0000 (08:47 -0400)
commit18947b95cd1668d1b98f7ea4196e97b050599f7d
treefe8a1e9eaa31529e7f59133db3a9043bd78a9bb0
parent3a602dc27aa7a830c0bf00838dfdbb70165858d5
show: Handle read and write errors

For showing a message in raw format, rather than silently succeeding
when a read or a write fails (or, probably, looping if a read fails),
try to print an error message and exit with a non-zero status.

This silences one of the buildbot warnings about unused results.  While
my libc lacks the declarations that trigger these warnings, this can
be tested by adding the following to notmuch.h:

__attribute__((warn_unused_result))
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
notmuch-show.c