diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-01-11 09:11:51 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-01-11 09:11:51 +0100 |
| commit | b7a82c980fe7e0c1f9029b55be97422428d65d5a (patch) | |
| tree | 67bedc856eb1f72a2daa8ef8347b904269b06df5 /src/util/efflush.h | |
| parent | vu-crop: add -t (diff) | |
| download | blind-b7a82c980fe7e0c1f9029b55be97422428d65d5a.tar.gz blind-b7a82c980fe7e0c1f9029b55be97422428d65d5a.tar.bz2 blind-b7a82c980fe7e0c1f9029b55be97422428d65d5a.tar.xz | |
Clean up code
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/util/efflush.h')
| -rw-r--r-- | src/util/efflush.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/efflush.h b/src/util/efflush.h new file mode 100644 index 0000000..001f2af --- /dev/null +++ b/src/util/efflush.h @@ -0,0 +1,12 @@ +/* See LICENSE file for copyright and license details. */ +#include <stdio.h> + +#define efflush(...) enfflush(1, __VA_ARGS__) + +static inline void +enfflush(int status, FILE *fp, const char *fname) +{ + fflush(fp); + if (ferror(fp)) + enprintf(status, "%s:", fname); +} |
