diff options
author | Jay Berkenbilt <ejb@ql.org> | 2013-02-28 21:49:08 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2013-03-05 19:35:46 +0100 |
commit | 66c3c8fdf7c60b34039bc9f70cd9bb00e0c0235d (patch) | |
tree | 503703336ef242487024d13c257e25d4fff3ae59 /libtests/qutil.cc | |
parent | 6b9297882e0106b5c0af53320673d6341b9bea91 (diff) | |
download | qpdf-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 'libtests/qutil.cc')
-rw-r--r-- | libtests/qutil.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libtests/qutil.cc b/libtests/qutil.cc index e293c374..8d9c2383 100644 --- a/libtests/qutil.cc +++ b/libtests/qutil.cc @@ -44,14 +44,12 @@ void string_conversion_test() void os_wrapper_test() { - int fd = -1; try { - std::cout << "before open" << std::endl; - fd = QUtil::os_wrapper("open file", - open("/this/file/does/not/exist", O_RDONLY)); - std::cout << "after open" << std::endl; - (void) close(fd); + std::cout << "before remove" << std::endl; + QUtil::os_wrapper("remove file", + remove("/this/file/does/not/exist")); + std::cout << "after remove" << std::endl; } catch (std::runtime_error& s) { |