summaryrefslogtreecommitdiff
path: root/tests/Capabilities_Test.cpp
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>1999-11-17 22:46:44 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>1999-11-17 22:46:44 +0000
commit33b305e3605ff164fbf08f1dab2b97a0b311482f (patch)
treecd90bb34eee5697f41cb49ad2502d77e92172da1 /tests/Capabilities_Test.cpp
parent2062162e01bc7a9644d456ee5d3270cf28118137 (diff)
downloadATCD-33b305e3605ff164fbf08f1dab2b97a0b311482f.tar.gz
Improved post-error file cleanup.
Diffstat (limited to 'tests/Capabilities_Test.cpp')
-rw-r--r--tests/Capabilities_Test.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/Capabilities_Test.cpp b/tests/Capabilities_Test.cpp
index 665a0d790d2..de7ae3bf3a4 100644
--- a/tests/Capabilities_Test.cpp
+++ b/tests/Capabilities_Test.cpp
@@ -67,7 +67,6 @@ main (int, char *[])
{
ACE_START_TEST (ASYS_TEXT ("Capabilities_Test"));
- int result = 0;
// --------------------------------------------------------
// Create config file
@@ -91,20 +90,20 @@ main (int, char *[])
if (ACE_OS::write (fd, file_contents, sizeof(file_contents)) !=
sizeof(file_contents))
{
- ACE_ERROR ((LM_ERROR, "%p\n", "ACE_OS::write"));
ACE_OS::unlink (config);
- result = -1;
+ ACE_OS::close (fd);
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_OS::write"), -1);
}
if (close (fd) != 0)
{
- ACE_ERROR ((LM_ERROR, "%p\n", "ACE_OS::close"));
ACE_OS::unlink (config);
- result = -1;
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_OS::close"), -1);
}
// --------------------------------------------------------
- result = load_config ();
+
+ int result = load_config ();
ACE_OS::unlink (config);