diff options
Diffstat (limited to 'libblkid/src/save.c')
-rw-r--r-- | libblkid/src/save.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libblkid/src/save.c b/libblkid/src/save.c index 86eda6cb..424017a3 100644 --- a/libblkid/src/save.c +++ b/libblkid/src/save.c @@ -21,6 +21,9 @@ #ifdef HAVE_ERRNO_H #include <errno.h> #endif + +#include "closestream.h" + #include "blkidP.h" static int save_dev(blkid_dev dev, FILE *file) @@ -148,7 +151,9 @@ int blkid_flush_cache(blkid_cache cache) ret = 1; } - fclose(file); + if (close_stream(file) != 0) + DBG(SAVE, blkid_debug("write failed: %s", filename)); + if (opened != filename) { if (ret < 0) { unlink(opened); |