summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-08-29 05:32:38 +0000
committerMichi Henning <michi@zeroc.com>2002-08-29 05:32:38 +0000
commit41697db9ab1008470ed946801f04e70006c8b0cf (patch)
tree54fc7414a11f03b99a9bedf5bf08662504bad1b8 /cpp
parentsome cleanup (diff)
downloadice-41697db9ab1008470ed946801f04e70006c8b0cf.tar.bz2
ice-41697db9ab1008470ed946801f04e70006c8b0cf.tar.xz
ice-41697db9ab1008470ed946801f04e70006c8b0cf.zip
Changed SystemException to SyscallException.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Makefile3
-rw-r--r--cpp/slice/Ice/LocalException.ice8
-rw-r--r--cpp/src/Glacier/StarterI.cpp10
-rw-r--r--cpp/src/Ice/Exception.cpp2
-rw-r--r--cpp/src/Ice/IdentityUtil.cpp6
-rw-r--r--cpp/src/Ice/Instance.cpp8
-rw-r--r--cpp/src/Ice/Network.cpp4
-rw-r--r--cpp/src/Ice/PropertiesI.cpp2
-rw-r--r--cpp/src/Ice/ThreadPool.cpp4
-rw-r--r--cpp/src/IcePack/ActivatorI.cpp20
-rw-r--r--cpp/src/IcePack/ServerI.cpp6
-rw-r--r--cpp/src/Slice/Parser.cpp11
-rw-r--r--cpp/src/XMLTransform/XMLTransform.cpp2
-rw-r--r--cpp/src/slice2freezej/Main.cpp4
14 files changed, 49 insertions, 41 deletions
diff --git a/cpp/demo/Makefile b/cpp/demo/Makefile
index 2ec0039322f..4b7f93c1b25 100644
--- a/cpp/demo/Makefile
+++ b/cpp/demo/Makefile
@@ -17,7 +17,8 @@ SUBDIRS = IceUtil \
Freeze \
IceStorm \
IceBox \
- Glacier
+ Glacier \
+ book
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
diff --git a/cpp/slice/Ice/LocalException.ice b/cpp/slice/Ice/LocalException.ice
index c144faf88f9..16147b9b994 100644
--- a/cpp/slice/Ice/LocalException.ice
+++ b/cpp/slice/Ice/LocalException.ice
@@ -176,11 +176,11 @@ local exception OperationNotExistException
*
* This exception is raised if a system error occurred in the server
* or client process. There are many possible causes for such a system
- * exception. For details on the cause, [SystemException::error]
+ * exception. For details on the cause, [SyscallException::error]
* should be inspected.
*
**/
-local exception SystemException
+local exception SyscallException
{
/**
*
@@ -196,11 +196,11 @@ local exception SystemException
/**
*
- * This exception is a specialization of [SystemException] for socket
+ * This exception is a specialization of [SyscallException] for socket
* errors.
*
**/
-local exception SocketException extends SystemException
+local exception SocketException extends SyscallException
{
};
diff --git a/cpp/src/Glacier/StarterI.cpp b/cpp/src/Glacier/StarterI.cpp
index 44971403e3a..6d034d72a35 100644
--- a/cpp/src/Glacier/StarterI.cpp
+++ b/cpp/src/Glacier/StarterI.cpp
@@ -134,14 +134,14 @@ Glacier::StarterI::startRouter(const string& userId, const string& password, Byt
{
if(pipe(fds) != 0)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
pid = fork();
if(pid == -1)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -289,7 +289,7 @@ Glacier::StarterI::startRouter(const string& userId, const string& password, Byt
flags |= O_NONBLOCK;
if(fcntl(fds[0], F_SETFL, flags) == -1)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -314,7 +314,7 @@ Glacier::StarterI::startRouter(const string& userId, const string& password, Byt
goto repeatSelect;
}
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -335,7 +335,7 @@ Glacier::StarterI::startRouter(const string& userId, const string& password, Byt
ssize_t sz = read(fds[0], buf, sizeof(buf)/sizeof(char) - 1);
if(sz == -1)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp
index 83d8908af8d..0f64228c893 100644
--- a/cpp/src/Ice/Exception.cpp
+++ b/cpp/src/Ice/Exception.cpp
@@ -137,7 +137,7 @@ Ice::OperationNotExistException::ice_print(ostream& out) const
}
void
-Ice::SystemException::ice_print(ostream& out) const
+Ice::SyscallException::ice_print(ostream& out) const
{
Exception::ice_print(out);
if(error != 0)
diff --git a/cpp/src/Ice/IdentityUtil.cpp b/cpp/src/Ice/IdentityUtil.cpp
index a8e2b968237..bf089c9b8c0 100644
--- a/cpp/src/Ice/IdentityUtil.cpp
+++ b/cpp/src/Ice/IdentityUtil.cpp
@@ -44,20 +44,20 @@ Ice::stringToIdentity(const string& s)
{
if(!decodeString(s, 0, 0, ident.name))
{
- throw SystemException(__FILE__, __LINE__);
+ throw SyscallException(__FILE__, __LINE__);
}
}
else
{
if(!decodeString(s, 0, slash, ident.category))
{
- throw SystemException(__FILE__, __LINE__);
+ throw SyscallException(__FILE__, __LINE__);
}
if(slash + 1 < s.size())
{
if(!decodeString(s, slash + 1, 0, ident.name))
{
- throw SystemException(__FILE__, __LINE__);
+ throw SyscallException(__FILE__, __LINE__);
}
}
}
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 33835fbb49c..d8e3a220980 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -258,21 +258,21 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, int& argc,
struct passwd* pw = getpwnam(newUser.c_str());
if(!pw)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
if(setgid(pw->pw_gid) == -1)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
if(setuid(pw->pw_uid) == -1)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -437,7 +437,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[])
if(daemon(nochdir, noclose) == -1)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index cc054098e7d..a93d113dcd6 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -615,7 +615,7 @@ IceInternal::getLocalHost(bool numeric)
char host[1024 + 1];
if(gethostname(host, 1024) == SOCKET_ERROR)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -712,7 +712,7 @@ IceInternal::createPipe(SOCKET fds[2])
if(::pipe(fds) != 0)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index 44874bc6623..566bd48ee43 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -151,7 +151,7 @@ Ice::PropertiesI::load(const std::string& file)
ifstream in(file.c_str());
if(!in)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index 7fa22c1f54a..4c1f1100aed 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -206,7 +206,7 @@ repeat:
goto repeat;
}
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -240,7 +240,7 @@ repeat:
goto repeat;
}
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
diff --git a/cpp/src/IcePack/ActivatorI.cpp b/cpp/src/IcePack/ActivatorI.cpp
index bb4c6516d84..7628fb8fa7c 100644
--- a/cpp/src/IcePack/ActivatorI.cpp
+++ b/cpp/src/IcePack/ActivatorI.cpp
@@ -58,7 +58,7 @@ IcePack::ActivatorI::ActivatorI(const TraceLevelsPtr& traceLevels) :
int fds[2];
if(pipe(fds) != 0)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -163,14 +163,14 @@ IcePack::ActivatorI::activate(const ServerPtr& server)
int fds[2];
if(pipe(fds) != 0)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
pid_t pid = fork();
if(pid == -1)
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -212,7 +212,7 @@ IcePack::ActivatorI::activate(const ServerPtr& server)
// // Send any errors to the parent process, using the write
// // end of the pipe.
// //
-// SystemException ex(__FILE__, __LINE__);
+// SyscallException ex(__FILE__, __LINE__);
// ex.error = getSystemErrno();
// ostringstream s;
// s << "can't redirect stderr to the pipe output";
@@ -233,7 +233,7 @@ IcePack::ActivatorI::activate(const ServerPtr& server)
// Send any errors to the parent process, using the write
// end of the pipe.
//
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
ostringstream s;
s << "can't change working directory to `" << pwd << "':\n" << ex;
@@ -249,7 +249,7 @@ IcePack::ActivatorI::activate(const ServerPtr& server)
// Send any errors to the parent process, using the write
// end of the pipe.
//
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
ostringstream s;
s << "can't execute `" << path << "':\n" << ex;
@@ -294,7 +294,7 @@ IcePack::ActivatorI::deactivate(const ServerPtr& server)
//
if(::kill(pid, SIGTERM))
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -316,7 +316,7 @@ IcePack::ActivatorI::kill(const ServerPtr& server)
//
if(::kill(pid, SIGKILL))
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -479,7 +479,7 @@ IcePack::ActivatorI::terminationListener()
goto repeatSelect;
}
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
@@ -530,7 +530,7 @@ IcePack::ActivatorI::terminationListener()
{
if(errno != EAGAIN || message.empty())
{
- SystemException ex(__FILE__, __LINE__);
+ SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
throw ex;
}
diff --git a/cpp/src/IcePack/ServerI.cpp b/cpp/src/IcePack/ServerI.cpp
index 0c25a8ff914..435fcb92ab2 100644
--- a/cpp/src/IcePack/ServerI.cpp
+++ b/cpp/src/IcePack/ServerI.cpp
@@ -94,7 +94,7 @@ IcePack::ServerI::start(ServerActivation activation, const Ice::Current& current
setState(active ? Active : Inactive);
return active;
}
- catch (const Ice::SystemException& ex)
+ catch (const Ice::SyscallException& ex)
{
Ice::Warning out(_traceLevels->logger);
out << "activation failed for server `" << description.name << "':\n";
@@ -360,7 +360,7 @@ IcePack::ServerI::stopInternal()
{
_activator->deactivate(this);
}
- catch (const Ice::SystemException& ex)
+ catch (const Ice::SyscallException& ex)
{
Ice::Warning out(_traceLevels->logger);
out << "deactivation failed for server `" << description.name << "':\n";
@@ -417,7 +417,7 @@ IcePack::ServerI::stopInternal()
{
_activator->kill(this);
}
- catch (const Ice::SystemException& ex)
+ catch (const Ice::SyscallException& ex)
{
Ice::Warning out(_traceLevels->logger);
out << "deactivation failed for server `" << description.name << "':\n";
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index 7df3db344dc..748b018d952 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -1418,9 +1418,16 @@ Slice::Container::checkPrefix(const string& name) const
{
if(_unit->currentIncludeLevel() == 0 && !_unit->allowIcePrefix())
{
- if(name.find("Ice", 0) == 0)
+ if(name.size() >= 3)
{
- _unit->error("illegal identifier `" + name + "': `Ice' prefix is reserved");
+ string prefix3;
+ prefix3 += tolower(name[0]);
+ prefix3 += tolower(name[1]);
+ prefix3 += tolower(name[2]);
+ if(prefix3 == "ice")
+ {
+ _unit->error("illegal identifier `" + name + "': `" + name.substr(0, 3) + "' prefix is reserved");
+ }
}
}
}
diff --git a/cpp/src/XMLTransform/XMLTransform.cpp b/cpp/src/XMLTransform/XMLTransform.cpp
index 268f676a5a2..f200bf9286b 100644
--- a/cpp/src/XMLTransform/XMLTransform.cpp
+++ b/cpp/src/XMLTransform/XMLTransform.cpp
@@ -2308,7 +2308,7 @@ XMLTransform::DBTransformer::DBTransformer()
catch(const XMLException& ex)
{
cerr << "Error during xerces initialization: " << toString(ex.getMessage()) << endl;
- throw Ice::SystemException(__FILE__, __LINE__); // TODO: Better exception?
+ throw Ice::SyscallException(__FILE__, __LINE__); // TODO: Better exception?
}
}
diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp
index 256bf86821b..58e391d0d9f 100644
--- a/cpp/src/slice2freezej/Main.cpp
+++ b/cpp/src/slice2freezej/Main.cpp
@@ -223,7 +223,7 @@ FreezeGenerator::generate(UnitPtr& unit, const Dict& dict)
out << eb;
out << nl << "catch(java.io.UnsupportedEncodingException ex)";
out << sb;
- out << nl << "Ice.SystemException e = new Ice.SystemException();";
+ out << nl << "Ice.SyscallException e = new Ice.SyscallException();";
out << nl << "e.initCause(ex);";
out << nl << "throw e;";
out << eb;
@@ -375,7 +375,7 @@ FreezeGenerator::generate(UnitPtr& unit, const Dict& dict)
out << eb;
out << nl << "catch(java.io.UnsupportedEncodingException ex)";
out << sb;
- out << nl << "Ice.SystemException e = new Ice.SystemException();";
+ out << nl << "Ice.SyscallException e = new Ice.SyscallException();";
out << nl << "e.initCause(ex);";
out << nl << "throw e;";
out << eb;