X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=chat%2Fchat.c;h=409285666644e8cecef28e677a66d46e47de61b7;hp=1b744a958c8fc6448d6633f0a66bc984032b58e5;hb=3fbc219d75acba054c5c74dde080b5ddaf1b1e7e;hpb=8197e4418d390af8d4286f15589e0704d8a387d0 diff --git a/chat/chat.c b/chat/chat.c index 1b744a9..4092856 100644 --- a/chat/chat.c +++ b/chat/chat.c @@ -78,7 +78,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: chat.c,v 1.17 1997/11/27 06:37:15 paulus Exp $"; +static char rcsid[] = "$Id: chat.c,v 1.19 1998/03/24 23:57:48 paulus Exp $"; #endif #include @@ -130,9 +130,17 @@ static char rcsid[] = "$Id: chat.c,v 1.17 1997/11/27 06:37:15 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) @@ -1004,7 +1012,6 @@ register char *s; if (clear_abort_next) { char *s1; - char *s2 = s; int i; int old_max; int pack = 0; @@ -1055,7 +1062,6 @@ register char *s; if (clear_report_next) { char *s1; - char *s2 = s; int i; int old_max; int pack = 0; @@ -1408,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 @@ -1478,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;