3 --- xispdial.c.orig Mon Oct 26 05:35:01 1998
4 +++ xispdial.c Tue Dec 1 03:01:28 1998
9 +#include <sys/param.h>
12 #include <sys/types.h>
15 char emsg[MSGLEN_ERR];
19 + sprintf(emsg, "xispdial: %s: %s\n", msg, strerror(errno));
22 sprintf(emsg, "xispdial: %s: %s\n", msg, sys_errlist[errno]);
24 sprintf(emsg, "xispdial: %s: error #%d\n", msg, errno);
26 - sprintf(emsg, "xispdial: %s: %s\n", msg, strerror(errno));
29 if (pipeFD) close(pipeFD);
31 if (!S_ISFIFO(st.st_mode)) /* is it a FIFO? */
32 doErr("namedPipe: stat"); /* nope, still not right! */
35 - fd = open(fname, O_WRONLY|O_NDELAY); /* yes, open it for writing */
38 fd = open(fname, O_WRONLY|O_NONBLOCK); /* yes, open it for writing */
39 +#elif (defined(BSD) && BSD >= 199306)
40 + fd = open(fname, O_WRONLY|O_NONBLOCK); /* yes, open it for writing */
42 + fd = open(fname, O_WRONLY|O_NDELAY); /* yes, open it for writing */
44 if (fd < 0) /* error means no process has */
45 doErr("namedPipe: open"); /* opened it for reading */
48 va_start(ap); /* start variable arg list */
49 fmt = va_arg(ap, char*); /* first string is format */
51 - iw = vsprintf(msg, fmt, ap); /* pass rest to vsprintf() */
53 +#ifdef BROKEN_VSPRINTF
54 vsprintf(msg, fmt, ap);
57 + iw = vsprintf(msg, fmt, ap); /* pass rest to vsprintf() */
59 va_end(ap); /* end variable arg list */
60 bw = write(pipeFD, msg, strlen(msg)); /* write buffer to pipe */
62 for (p=param; *p;) { /* scan the line */
63 if (*p == '\\') { /* if a '\\' is found */
64 if (escape) { /* if auto escaping selected */
66 - memmove(p+1, p, zlen); /* increase string len by 1 */
68 + bcopy(p, p+1, zlen) /* increase string len by 1 */;
69 #else /* by duplicating the string */
70 - bcopy(p, p+1, zlen); /* contents starting from */
71 + memmove(p+1, p, zlen); /* contents starting from */
72 #endif /* next character position */
73 *p = '\\'; /* insert an extra '\\' */
74 p += 2; /* skip the next '\\' */
76 else { /* deletion of '\\'s desired */
78 - memmove(p, p+1, zlen); /* decrease string len by 1 */
80 + bcopy(p+1, p, zlen); /* decrease string len by 1 */
82 - bcopy(p+1, p, zlen);
83 + memmove(p, p+1, zlen);