summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mkid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mkid.c b/src/mkid.c
index c0528cb..031e53b 100644
--- a/src/mkid.c
+++ b/src/mkid.c
@@ -664,7 +664,7 @@ write_id_file (struct idhead *idhp)
idhp->idh_vec_size = max_vec_size;
write_idhead (&idh);
- if (fclose (idhp->idh_FILE) != 0)
+ if (ferror (idhp->idh_FILE) || fclose (idhp->idh_FILE) != 0)
error (1, errno, _("error closing `%s'"), idhp->idh_file_name);
}