summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-05-22 09:42:10 +0200
committerJim Meyering <meyering@redhat.com>2008-05-22 09:42:10 +0200
commit975f99332d5cd48c17fbd61df75f71a87e5067c6 (patch)
tree8911f34e04047a0ab6c65e42b1e2249ae7cf38a1 /src
parentb47e28bbc861470014de386fc116335f29de0656 (diff)
downloadidutils-975f99332d5cd48c17fbd61df75f71a87e5067c6.tar.gz
idutils-975f99332d5cd48c17fbd61df75f71a87e5067c6.tar.bz2
idutils-975f99332d5cd48c17fbd61df75f71a87e5067c6.zip
don't ignore pre-fclose ID-file write error
* src/mkid.c (write_id_file): Test ferror, too.
Diffstat (limited to 'src')
-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);
}