X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=chat%2Fchat.c;h=409285666644e8cecef28e677a66d46e47de61b7;hp=006841359ee0b9a1848c9a296ee36c0514485ae2;hb=7097785dc774ed0ff166a0434a90ffc342814ae9;hpb=42f98236389c506f0790b56d633bfbea3b12c20e;ds=sidebyside diff --git a/chat/chat.c b/chat/chat.c index 0068413..4092856 100644 --- a/chat/chat.c +++ b/chat/chat.c @@ -78,7 +78,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: chat.c,v 1.16 1997/11/27 06:00:06 paulus Exp $"; +static char rcsid[] = "$Id: chat.c,v 1.19 1998/03/24 23:57:48 paulus Exp $"; #endif #include @@ -106,15 +106,6 @@ static char rcsid[] = "$Id: chat.c,v 1.16 1997/11/27 06:00:06 paulus Exp $"; #include #endif -#if __STDC__ -#include -#define __V(x) x -#else -#include -#define __V(x) (va_alist) va_dcl -#define const -#endif - #define STR_LEN 1024 #ifndef SIGTYPE @@ -139,9 +130,17 @@ static char rcsid[] = "$Id: chat.c,v 1.16 1997/11/27 06:00:06 paulus Exp $"; #define O_NONBLOCK O_NDELAY #endif +#ifdef SUNOS +extern int sys_nerr; +extern char *sys_errlist[]; +#define memmove(to, from, n) bcopy(from, to, n) +#define strerror(n) ((unsigned)(n) < sys_nerr? sys_errlist[(n)] :\ + "unknown error") +#endif + /*************** Micro getopt() *********************************************/ #define OPTION(c,v) (_O&2&&**v?*(*v)++:!c||_O&4?0:(!(_O&1)&& \ - ((--c,++v),_O=4,c)&&**v=='-'&&v[0][1]?*++*v=='-'\ + (--c,++v),_O=4,c&&**v=='-'&&v[0][1]?*++*v=='-'\ &&!v[0][1]?(--c,++v,0):(_O=2,*(*v)++):0)) #define OPTARG(c,v) (_O&2?**v||(++v,--c)?(_O=1,--c,*v++): \ (_O=4,(char*)0):(char*)0) @@ -470,7 +469,7 @@ void logf __V((const char *fmt, ...)) { va_list args; -#if __STDC__ +#ifdef __STDC__ va_start(args, fmt); #else char *fmt; @@ -493,7 +492,7 @@ void fatal __V((int code, const char *fmt, ...)) { va_list args; -#if __STDC__ +#ifdef __STDC__ va_start(args, fmt); #else int code; @@ -1013,7 +1012,6 @@ register char *s; if (clear_abort_next) { char *s1; - char *s2 = s; int i; int old_max; int pack = 0; @@ -1064,7 +1062,6 @@ register char *s; if (clear_report_next) { char *s1; - char *s2 = s; int i; int old_max; int pack = 0; @@ -1417,6 +1414,16 @@ register char *string; return (0); } +/* + * Gross kludge to handle Solaris versions >= 2.6 having usleep. + */ +#ifdef SOL2 +#include +#if MAXUID > 65536 /* then this is Solaris 2.6 or later */ +#undef NO_USLEEP +#endif +#endif /* SOL2 */ + #ifdef NO_USLEEP #include #include @@ -1487,7 +1494,6 @@ vfmtmsg(buf, buflen, fmt, args) const char *f; unsigned char *p; char num[32]; - time_t t; static char hexchars[] = "0123456789abcdef"; buf0 = buf;