signal handlers that was part of the code under #ifdef BSD42.
AC_SUBST(SIGNAL_H)dnl
dnl ----------------
-dnl OS SPECIFIC DEFINES
-dnl ----------------
-AH_TEMPLATE(SYS5, [Defined for Solaris 2.x, Irix, OSF/1, HP-UX, AIX, SCO5; only used in vmh.c which is not built.])
-AH_TEMPLATE(SVR4, [Defined for Solaris 2.x, Irix, OSF/1, HP-UX, AIX; only used in vmh.c which is not built.])
-AH_TEMPLATE(BSD44, [Defined for SunOS 4, FreeBSD, NetBSD, OpenBSD, BSD/OS, Mac OS X/Rhapsody; only used in vmh.c which is not built.])
-AH_TEMPLATE(BSD42, [Defined for SunOS 4, FreeBSD, NetBSD, OpenBSD, BSD/OS, Mac OS X/Rhapsody -- does PicoBSD have uname?])
-AH_TEMPLATE(SCO_5_STDIO, [Defined for SCO5.])
-
-case "$target_os" in
-
- solaris2*)
- AC_DEFINE(SYS5)
- AC_DEFINE(SVR4)
- ;;
- irix*)
- AC_DEFINE(SYS5)
- AC_DEFINE(SVR4)
- ;;
- osf*)
- AC_DEFINE(SYS5)
- AC_DEFINE(SVR4)
- ;;
- aix*)
- AC_DEFINE(SYS5)
- AC_DEFINE(SVR4)
- ;;
- sunos4*)
- AC_DEFINE(BSD42)
- ;;
- freebsd*)
- AC_DEFINE(BSD42)
- AC_DEFINE(BSD44)
- ;;
- netbsd*)
- AC_DEFINE(BSD42)
- AC_DEFINE(BSD44)
- ;;
- openbsd*)
- AC_DEFINE(BSD42)
- AC_DEFINE(BSD44)
- ;;
- bsd/os*)
- AC_DEFINE(BSD42)
- AC_DEFINE(BSD44)
- ;;
- sco5*)
- AC_DEFINE(SYS5)
- AC_DEFINE(SCO_5_STDIO)
- ;;
-esac
-
-
-dnl ----------------
dnl OUTPUT MAKEFILES
dnl ----------------
AC_CONFIG_FILES(Makefile config/Makefile h/Makefile sbr/Makefile uip/Makefile \
extern int broken_pipe; /* SIGPIPE detected */
extern int told_to_quit; /* SIGQUIT detected */
-#ifdef BSD42
-extern int should_intr; /* signal handler should interrupt call */
-extern jmp_buf sigenv; /* the environment pointer */
-#endif
-
/*
* prototypes
*/
#include <termios.h>
-#ifdef SCO_5_STDIO
-# define _ptr __ptr
-# define _cnt __cnt
-# define _base __base
-# define _filbuf(fp) ((fp)->__cnt = 0, __filbuf(fp))
-#endif
-
void
discard (FILE *io)
# define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
#endif
-#ifdef SCO_5_STDIO
-# define _ptr __ptr
-# define _cnt __cnt
-# define _base __base
-# define _filbuf(fp) ((fp)->__cnt = 0, __filbuf(fp))
-# define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
-#endif
-
#ifndef DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
extern int _filbuf(FILE*);
#endif
field, like phone number. Also, if mmailid masquerading is turned on due
to "mmailid" appearing on the "masquerade:" line of mts.conf, stop if we
hit a '<' (which should precede any ','s). */
-#ifndef BSD42
if (mmailid_masquerading)
/* Stop at ',' or '<'. */
for (cp = fullname; *np != '\0' && *np != ',' && *np != '<';
for (cp = fullname; *np != '\0' && *np != ',';
*cp++ = *np++)
continue;
-#else /* BSD42 */
- /* On BSD(-derived) systems, the system utilities that deal with the GECOS
- field (finger, mail, sendmail, etc.) translate any '&' character in it to
- the login name, with the first letter capitalized. So, for instance,
- fingering a user "bob" with the GECOS field "& Jones" would reveal him to
- be "In real life: Bob Jones". Surprisingly, though, the OS doesn't do
- the translation for you, so we have to do it manually here. */
- if (mmailid_masquerading)
- /* Stop at ',' or '<'. */
- for (cp = fullname;
- *np != '\0' && *np != ',' && *np != '<';) {
- if (*np == '&') { /* blech! */
- strcpy (cp, pw->pw_name);
- *cp = toupper(*cp);
- while (*cp)
- cp++;
- np++;
- } else {
- *cp++ = *np++;
- }
- }
- else
- /* Allow '<' as a legal character of the user's name. This code is
- basically a duplicate of the code above the "else" -- we don't
- collapse it down to one copy and put the mmailid_masquerading check
- inside the loop with "(x ? y : z)" because that's inefficient and the
- value'll never change while it's in there. */
- for (cp = fullname;
- *np != '\0' && *np != ',';) {
- if (*np == '&') { /* blech! */
- strcpy (cp, pw->pw_name);
- *cp = toupper(*cp);
- while (*cp)
- cp++;
- np++;
- } else {
- *cp++ = *np++;
- }
- }
-#endif /* BSD42 */
*cp = '\0';
if (mmailid_masquerading) {
static int partno, pid;
static time_t clock = 0;
-#ifdef BSD42
- usemap = strchr (id, '/') ? 1 : 0;
-#else
usemap = 1;
-#endif
if (debugsw)
fprintf (stderr, "find_cache_aux %s usemap=%d\n", directory, usemap);
int broken_pipe; /* SIGPIPE detected */
int told_to_quit; /* SIGQUIT detected */
-#ifdef BSD42
-int should_intr; /* signal handler should interrupt call */
-jmp_buf sigenv; /* the environment pointer */
-#endif
-
/*
* prototypes
*/
ioctl (pfd, FIOCLEX, NULL);
#endif /* FIOCLEX */
-#ifdef BSD42
- should_intr = 0;
-#endif /* BSD42 */
istat = SIGNAL2 (SIGINT, intrser);
qstat = SIGNAL2 (SIGQUIT, quitser);
if (sp == NULL) {
if ((sd = dup (fileno (stdout))) == NOTOK)
padios ("standard output", "unable to dup");
-#ifndef BSD42 /* XXX */
#ifdef FIOCLEX
ioctl (sd, FIOCLEX, NULL);
#endif /* FIOCLEX */
-#endif /* not BSD42 */
if ((sp = fdopen (sd, "w")) == NULL)
padios ("standard output", "unable to fdopen");
}
told_to_quit = 0;
for (;;) {
interrupted = 0;
-#ifdef BSD42
- switch (setjmp (sigenv)) {
- case OK:
- should_intr = 1;
- break;
-
- default:
- should_intr = 0;
- if (interrupted && !told_to_quit) {
- putchar ('\n');
- continue;
- }
- if (ppid > 0)
-#ifdef SIGEMT
- kill (ppid, SIGEMT);
-#else
- kill (ppid, SIGTERM);
-#endif
- return EOF;
- }
-#endif /* BSD42 */
if (interactive) {
printf ("%s", prompt);
fflush (stdout);
}
for (cp = buffer; (i = getchar ()) != '\n';) {
-#ifndef BSD42
if (interrupted && !told_to_quit) {
buffer[0] = '\0';
putchar ('\n');
#endif
return EOF;
}
-#else /* BSD42 */
- if (i == EOF)
- longjmp (sigenv, DONE);
-#endif /* BSD42 */
if (cp < &buffer[sizeof buffer - 2])
*cp++ = i;
}
cmdp->args[0]);
continue;
default:
-#ifdef BSD42
- should_intr = 0;
-#endif /* BSD42 */
return i;
}
}
{
discard (stdout);
interrupted++;
-
-#ifdef BSD42
- if (should_intr)
- longjmp (sigenv, NOTOK);
-#endif
}
fprintf (stderr, "broken pipe\n");
told_to_quit++;
interrupted++;
-
-#ifdef BSD42
- if (should_intr)
- longjmp (sigenv, NOTOK);
-#endif
}
{
told_to_quit++;
interrupted++;
-
-#ifdef BSD42
- if (should_intr)
- longjmp (sigenv, NOTOK);
-#endif
}
fflush (stdout);
buf[0] = 0;
-#ifndef BSD42
read (fileno (stdout), buf, sizeof buf);
-#else /* BSD42 */
- switch (setjmp (sigenv)) {
- case OK:
- should_intr = 1;
- read (fileno (stdout), buf, sizeof buf);/* fall... */
-
- default:
- should_intr = 0;
- break;
- }
-#endif /* BSD42 */
if (strchr(buf, '\n') == NULL)
putchar ('\n');
# define _cnt _w /* Wretch */
#endif
-#ifdef SCO_5_STDIO
-# define _ptr __ptr
-# define _cnt __cnt
-# define _base __base
-# define _filbuf(fp) ((fp)->__cnt = 0, __filbuf(fp))
-#endif
-
#define MAXSCANL 256 /* longest possible scan line */
/*