fallocate: check writing to a file descriptor was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2013-04-13 20:54:58 +01:00 committed by Karel Zak
parent de2ca55931
commit 5f52af507b
1 changed files with 2 additions and 1 deletions

View File

@ -168,6 +168,7 @@ int main(int argc, char **argv)
err(EXIT_FAILURE, _("%s: fallocate failed"), fname);
}
close(fd);
if (close_fd(fd) != 0)
err(EXIT_FAILURE, _("write failed: %s"), fname);
return EXIT_SUCCESS;
}