From 58a5b548261135451ced62ece49e6e6ac4357986 Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 10 May 1994 11:35:13 +0000 Subject: replaced TRUE/FALSE by true/false Added fcntl.h --- comm/error.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'comm') diff --git a/comm/error.cc b/comm/error.cc index f46ba3d..f35725a 100644 --- a/comm/error.cc +++ b/comm/error.cc @@ -20,6 +20,7 @@ #ifdef sun extern "C" int rename (const char*, const char*); #endif +#include #include #include #include "ccu/Time.h" @@ -68,7 +69,7 @@ char* ErrorTable [] = { }; static char ProgName [256], LogFile [256]; -static bool LogOn =FALSE; +static bool LogOn =false; static int LogFd = -1; static off_t LogSize = 0; static off_t LogHalf = 0; @@ -90,21 +91,21 @@ static bool HandleError (errtype how, const char* who, const char* what) { if (how == ErrNone) - return TRUE; + return true; char *msg = MakeErrorString (how, who, what); if (how >= ErrLog) { LogMessage (msg); if (how == ErrLog) - return TRUE; + return true; } how = (*Handler) (how, who, what, msg); switch (how) { case ErrNone: - return TRUE; + return true; case ErrLog: case ErrWarn: break; @@ -120,7 +121,7 @@ HandleError (errtype how, const char* who, const char* what) exit (1); break; } - return FALSE; + return false; } // public functions: @@ -145,7 +146,7 @@ ProgramName (const char* name) /*? Set the log file name. All messages are appended to the logfile. -If \var{reset} is TRUE, the file is renamed to \var{file$\sim$}. +If \var{reset} is true, the file is renamed to \var{file$\sim$}. If this fails, the file is simply cleared. If the \com{LOGDIR} environment variable is defined, and if \var{file} does not start with \com{/} or \com{./}, the value of \com{LOGDIR} is @@ -185,7 +186,7 @@ LogfileName (const char* file, bool reset) } strcat (LogFile, file); - LogOn = TRUE; + LogOn = true; int flags = O_RDWR | O_CREAT; if (reset) { flags |= O_TRUNC; @@ -200,7 +201,7 @@ LogfileName (const char* file, bool reset) LogFd = open (LogFile, flags, 0644); if (LogFd < 0) { SysError (ErrWarn, "LogfileName"); - LogOn = FALSE; + LogOn = false; } else { LogHalf = 0; if (reset) @@ -214,7 +215,7 @@ LogfileName (const char* file, bool reset) } else { if (LogOn && LogFd >= 0) close (LogFd); - LogOn = FALSE; + LogOn = false; } } @@ -328,7 +329,7 @@ Emit a system error of type \var{how}, from function \var{who}. The message is retrieved from the value of the global variable \var{errno}. Thus, this function should be used after system calls that set \var{errno}. \var{exc1} and \var{exc2}, if non negative, are error codes (values of \var{errno}) to be ignored: -if the current error code is one of these, the function returns FALSE. +if the current error code is one of these, the function returns false. This is useful for instance to ignore interrupted system calls: \begin{ccode} #include @@ -347,7 +348,7 @@ SysError (errtype how, const char* who, int exc1, int exc2) char defmsg [80]; if (! errno || errno == exc1 || errno == exc2) - return FALSE; + return false; if (errno >= sys_nerr) sprintf (msg = defmsg, "system error code %d", errno); -- cgit v1.1