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. --- libtests/qtest/qutil/qutil.out | 4 ++-- libtests/qutil.cc | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'libtests') diff --git a/libtests/qtest/qutil/qutil.out b/libtests/qtest/qutil/qutil.out index c855e98e..737e4c72 100644 --- a/libtests/qtest/qutil/qutil.out +++ b/libtests/qtest/qutil/qutil.out @@ -12,8 +12,8 @@ one 7 compare okay ---- -before open -exception: open file: No such file or directory +before remove +exception: remove file: No such file or directory ---- before fopen exception: fopen file: No such file or directory 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) { -- cgit v1.2.3-54-g00ecf