From 66c3c8fdf7c60b34039bc9f70cd9bb00e0c0235d Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 28 Feb 2013 15:49:08 -0500 Subject: Use portable versions of some UNIX-specific calls Remove needless calls to open, close, and fileno; call remove instead of unlink. --- libqpdf/Pl_StdioFile.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libqpdf/Pl_StdioFile.cc') 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 + -- cgit v1.2.3-54-g00ecf