From 7db65aa3d43b934793aa7cc03c5adbe1f1876a20 Mon Sep 17 00:00:00 2001 From: Marc Laukien Date: Tue, 13 Jan 2004 16:07:56 +0000 Subject: promotion fix --- cpp/test/IceStorm/single/Subscriber.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'cpp/test/IceStorm/single/Subscriber.cpp') diff --git a/cpp/test/IceStorm/single/Subscriber.cpp b/cpp/test/IceStorm/single/Subscriber.cpp index d955e965340..0767819523d 100644 --- a/cpp/test/IceStorm/single/Subscriber.cpp +++ b/cpp/test/IceStorm/single/Subscriber.cpp @@ -15,10 +15,13 @@ #include #include #include -#include #ifdef _WIN32 # include +#else +# include +# include +# include #endif using namespace std; @@ -53,17 +56,23 @@ private: void createLock(const string& name) { - ofstream f(name.c_str()); +#ifdef _WIN32 + int ret = _open(name.c_str(), O_CREAT | O_WRONLY | O_EXCL); +#else + int ret = open(name.c_str(), O_CREAT | O_WRONLY | O_EXCL); +#endif + assert(ret != -1); } void deleteLock(const string& name) { #ifdef _WIN32 - _unlink(name.c_str()); + int ret = _unlink(name.c_str()); #else - unlink(name.c_str()); + int ret = unlink(name.c_str()); #endif + assert(ret != -1); } int -- cgit v1.2.3