diff options
Diffstat (limited to 'generic/tclPosixStr.c')
-rw-r--r-- | generic/tclPosixStr.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c index a11b532..5c1a1b9 100644 --- a/generic/tclPosixStr.c +++ b/generic/tclPosixStr.c @@ -9,6 +9,8 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: @(#) $Id: tclPosixStr.c,v 1.15 2009/03/15 15:35:46 dkf Exp $ */ #include "tclInt.h" @@ -31,11 +33,11 @@ *---------------------------------------------------------------------- */ -CONST char * +const char * Tcl_ErrnoId(void) { switch (errno) { -#if defined(E2BIG) && (!defined(EOVERFLOW) || (E2BIG != EOVERFLOW)) +#ifdef E2BIG case E2BIG: return "E2BIG"; #endif #ifdef EACCES @@ -269,7 +271,7 @@ Tcl_ErrnoId(void) #ifdef ENOLCK case ENOLCK: return "ENOLCK"; #endif -#if defined(ENOLINK) && (!defined(ESOCKTNOSUPPORT) || (ESOCKTNOSUPPORT != ENOLINK)) +#ifdef ENOLINK case ENOLINK: return "ENOLINK"; #endif #ifdef ENOMEM @@ -284,7 +286,7 @@ Tcl_ErrnoId(void) #ifdef ENOPKG case ENOPKG: return "ENOPKG"; #endif -#if defined(ENOPROTOOPT) && (!defined(EPFNOSUPPORT) || (EPFNOSUPPORT != ENOPROTOOPT)) +#ifdef ENOPROTOOPT case ENOPROTOOPT: return "ENOPROTOOPT"; #endif #ifdef ENOSPC @@ -477,12 +479,12 @@ Tcl_ErrnoId(void) *---------------------------------------------------------------------- */ -CONST char * +const char * Tcl_ErrnoMsg( int err) /* Error number (such as in errno variable). */ { switch (err) { -#if defined(E2BIG) && (!defined(EOVERFLOW) || (E2BIG != EOVERFLOW)) +#ifdef E2BIG case E2BIG: return "argument list too long"; #endif #ifdef EACCES @@ -717,8 +719,8 @@ Tcl_ErrnoMsg( #ifdef ENOLCK case ENOLCK: return "no locks available"; #endif -#if defined(ENOLINK) && (!defined(ESOCKTNOSUPPORT) || (ESOCKTNOSUPPORT != ENOLINK)) - case ENOLINK: return "link has been severed"; +#ifdef ENOLINK + case ENOLINK: return "link has be severed"; #endif #ifdef ENOMEM case ENOMEM: return "not enough memory"; @@ -732,7 +734,7 @@ Tcl_ErrnoMsg( #ifdef ENOPKG case ENOPKG: return "package not installed"; #endif -#if defined(ENOPROTOOPT) && (!defined(EPFNOSUPPORT) || (EPFNOSUPPORT != ENOPROTOOPT)) +#ifdef ENOPROTOOPT case ENOPROTOOPT: return "bad protocol option"; #endif #ifdef ENOSPC @@ -811,7 +813,7 @@ Tcl_ErrnoMsg( case EPROTO: return "protocol error"; #endif #ifdef EPROTONOSUPPORT - case EPROTONOSUPPORT: return "protocol not supported"; + case EPROTONOSUPPORT: return "protocol not suppored"; #endif #ifdef EPROTOTYPE case EPROTOTYPE: return "protocol wrong type for socket"; @@ -847,7 +849,7 @@ Tcl_ErrnoMsg( case ERREMOTE: return "object is remote"; #endif #ifdef ESHUTDOWN - case ESHUTDOWN: return "can't send after socket shutdown"; + case ESHUTDOWN: return "can't send afer socket shutdown"; #endif #ifdef ESOCKTNOSUPPORT case ESOCKTNOSUPPORT: return "socket type not supported"; @@ -904,7 +906,7 @@ Tcl_ErrnoMsg( #ifdef NO_STRERROR return "unknown POSIX error"; #else - return strerror(err); + return strerror(errno); #endif } } @@ -927,7 +929,7 @@ Tcl_ErrnoMsg( *---------------------------------------------------------------------- */ -CONST char * +const char * Tcl_SignalId( int sig) /* Number of signal. */ { @@ -992,7 +994,7 @@ Tcl_SignalId( #ifdef SIGQUIT case SIGQUIT: return "SIGQUIT"; #endif -#if defined(SIGSEGV) && (!defined(SIGBUS) || (SIGSEGV != SIGBUS)) +#ifdef SIGSEGV case SIGSEGV: return "SIGSEGV"; #endif #ifdef SIGSTOP @@ -1061,7 +1063,7 @@ Tcl_SignalId( *---------------------------------------------------------------------- */ -CONST char * +const char * Tcl_SignalMsg( int sig) /* Number of signal. */ { @@ -1126,7 +1128,7 @@ Tcl_SignalMsg( #ifdef SIGQUIT case SIGQUIT: return "quit signal"; #endif -#if defined(SIGSEGV) && (!defined(SIGBUS) || (SIGSEGV != SIGBUS)) +#ifdef SIGSEGV case SIGSEGV: return "segmentation violation"; #endif #ifdef SIGSTOP |