summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/nslist/nsadd.cpp22
-rw-r--r--utils/nslist/nsdel.cpp20
-rw-r--r--utils/nslist/nslist.cpp17
3 files changed, 43 insertions, 16 deletions
diff --git a/utils/nslist/nsadd.cpp b/utils/nslist/nsadd.cpp
index beaab182720..18d03aded3e 100644
--- a/utils/nslist/nsadd.cpp
+++ b/utils/nslist/nsadd.cpp
@@ -1,4 +1,3 @@
-
//=============================================================================
/**
* @file nsadd.cpp
@@ -13,7 +12,6 @@
*/
//=============================================================================
-
#include "orbsvcs/CosNamingC.h"
#include "ace/Log_Msg.h"
#include "ace/OS_NS_string.h"
@@ -28,6 +26,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
CORBA::ORB_var orb;
const ACE_TCHAR *ior = 0;
+ int err = 0;
+
try
{
// Contact the orb
@@ -366,7 +366,6 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
root_nc->bind (the_name, obj.in ());
}
}
- orb->destroy ();
}
catch (const CosNaming::NamingContext::NotFound& nf)
{
@@ -406,18 +405,27 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
ACE_DEBUG ((LM_DEBUG, "ID: %C\n",
nf.rest_of_name[index].id.in()));
}
- orb->destroy ();
- return 1;
+ ++err;
}
catch (const CORBA::Exception& ex)
{
ACE_DEBUG ((LM_DEBUG, "\nError:\n"));
ex._tao_print_exception ("Exception in nsadd");
orb->destroy ();
- return 1;
+ ++err;
}
- return 0;
+ try
+ {
+ orb->destroy ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_DEBUG ((LM_DEBUG, "\nError:\n"));
+ ex._tao_print_exception ("Exception in while shutting down");
+ ++err;
+ }
+ return err;
}
diff --git a/utils/nslist/nsdel.cpp b/utils/nslist/nsdel.cpp
index 0b426a93c8d..995ad096eec 100644
--- a/utils/nslist/nsdel.cpp
+++ b/utils/nslist/nsdel.cpp
@@ -62,6 +62,7 @@ namespace
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
+ int err = 0;
CosNaming::Name the_name (0);
CORBA::ORB_var orb;
@@ -331,7 +332,6 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
}
}
}
- orb->destroy ();
}
catch (const CosNaming::NamingContext::NotFound& nf)
{
@@ -372,16 +372,24 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
ACE_DEBUG ((LM_DEBUG, "ID: %C\n",
nf.rest_of_name[index].id.in()));
}
- orb->destroy ();
- return 1;
+ ++err;
}
catch (const CORBA::Exception& ex)
{
ACE_DEBUG ((LM_DEBUG, "\nError:\n"));
ex._tao_print_exception ("Exception in nsdel");
- orb->destroy ();
- return 1;
+ ++err;
}
- return 0;
+ try
+ {
+ orb->destroy ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_DEBUG ((LM_DEBUG, "\nError:\n"));
+ ex._tao_print_exception ("Exception in while shutting down");
+ ++err;
+ }
+ return err;
}
diff --git a/utils/nslist/nslist.cpp b/utils/nslist/nslist.cpp
index a37959d410a..6ac49370a10 100644
--- a/utils/nslist/nslist.cpp
+++ b/utils/nslist/nslist.cpp
@@ -361,6 +361,8 @@ namespace
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
+ int err = 0;
+
try
{
// Contact the orb
@@ -718,14 +720,23 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
((showCtxIOR)? str.in () : "")));
list_context (root_nc.in (), 1);
}
- orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Exception in nslist");
+ ++err;
+ }
+
+ try
+ {
orb->destroy ();
- return -1;
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_DEBUG ((LM_DEBUG, "\nError:\n"));
+ ex._tao_print_exception ("Exception in while shutting down");
+ ++err;
}
- return 0;
+ return err;
}