From 7f0816001e085f482f8f9a34b7f8e06435907510 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 20 Sep 2017 11:05:13 +0200 Subject: Clean C++ exception code to only throw exception types - Update C++ code to only throw types derived from C++ exception - Update C++ code to use one-shot constructors to create the exceptions Fix bug ICE-7892 --- cpp/src/IceUtil/FileUtil.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cpp/src/IceUtil/FileUtil.cpp') diff --git a/cpp/src/IceUtil/FileUtil.cpp b/cpp/src/IceUtil/FileUtil.cpp index b006013ca97..e6a6a9284b2 100644 --- a/cpp/src/IceUtil/FileUtil.cpp +++ b/cpp/src/IceUtil/FileUtil.cpp @@ -454,9 +454,9 @@ IceUtilInternal::FileLock::FileLock(const std::string& path) : // if(::fcntl(_fd, F_SETLK, &lock) == -1) { - IceUtil::FileLockException ex(__FILE__, __LINE__, errno, _path); + int err = errno; close(_fd); - throw ex; + throw IceUtil::FileLockException(__FILE__, __LINE__, err, _path); } // @@ -473,9 +473,9 @@ IceUtilInternal::FileLock::FileLock(const std::string& path) : if(write(_fd, os.str().c_str(), os.str().size()) == -1) { - IceUtil::FileLockException ex(__FILE__, __LINE__, errno, _path); + int err = errno; close(_fd); - throw ex; + throw IceUtil::FileLockException(__FILE__, __LINE__, err, _path); } } -- cgit v1.2.3