summaryrefslogtreecommitdiff
path: root/comm/error.cc
diff options
context:
space:
mode:
Diffstat (limited to 'comm/error.cc')
-rw-r--r--comm/error.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/comm/error.cc b/comm/error.cc
index f35725a..9ddc674 100644
--- a/comm/error.cc
+++ b/comm/error.cc
@@ -23,11 +23,11 @@ extern "C" int rename (const char*, const char*);
#include <fcntl.h>
#include <stdio.h>
#include <sys/file.h>
-#include "ccu/Time.h"
+#include "ivl/Time.h"
#include <sys/types.h>
#include <sys/stat.h>
-/*?class UchERROR
+/*?class IvlERROR
The set of global functions described here are designed to handle errors.
An error has a type, an origin, and a message.
The type defines how the error is handled.
@@ -235,7 +235,7 @@ LogMessage (const char* msg)
if (! LogOn || LogFd < 0)
return;
- CcuTimeStamp now;
+ IvlTimeStamp now;
// format of time: Sun Sep 16 01:03:52 1973\n\0
// 123456789012345678901234
LogSize += write (LogFd, now.AsString (), 20); // strip year
@@ -343,20 +343,23 @@ SysError (errtype how, const char* who, int exc1, int exc2)
{
extern int errno;
extern int sys_nerr;
- extern char* sys_errlist [];
- char* msg;
+ extern const char* const sys_errlist [];
+ const char* msg;
char defmsg [80];
if (! errno || errno == exc1 || errno == exc2)
return false;
- if (errno >= sys_nerr)
- sprintf (msg = defmsg, "system error code %d", errno);
- else
- if (errno == 0)
+ if (errno >= sys_nerr) {
+ sprintf (defmsg, "system error code %d", errno);
+ msg = defmsg;
+
+ } else if (errno == 0)
msg = "internal error";
+
else
msg = sys_errlist [errno];
+
return HandleError (how, who, msg);
}