aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/Pl_StdioFile.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-02-28 21:49:08 +0100
committerJay Berkenbilt <ejb@ql.org>2013-03-05 19:35:46 +0100
commit66c3c8fdf7c60b34039bc9f70cd9bb00e0c0235d (patch)
tree503703336ef242487024d13c257e25d4fff3ae59 /libqpdf/Pl_StdioFile.cc
parent6b9297882e0106b5c0af53320673d6341b9bea91 (diff)
downloadqpdf-66c3c8fdf7c60b34039bc9f70cd9bb00e0c0235d.tar.zst
Use portable versions of some UNIX-specific calls
Remove needless calls to open, close, and fileno; call remove instead of unlink.
Diffstat (limited to 'libqpdf/Pl_StdioFile.cc')
-rw-r--r--libqpdf/Pl_StdioFile.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/libqpdf/Pl_StdioFile.cc b/libqpdf/Pl_StdioFile.cc
index 808177d0..4d3cba60 100644
--- a/libqpdf/Pl_StdioFile.cc
+++ b/libqpdf/Pl_StdioFile.cc
@@ -37,11 +37,8 @@ Pl_StdioFile::write(unsigned char* buf, size_t len)
void
Pl_StdioFile::finish()
{
- if (fileno(this->file) != -1) // XXXX
- {
- fflush(this->file);
- }
- else
+ if ((fflush(this->file) == -1) &&
+ (errno == EBADF))
{
throw std::logic_error(
this->identifier +