projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
In test-post-common.sh and test-mhmail, wait for fakesmtp to start
[mmh]
/
uip
/
msh.c
diff --git
a/uip/msh.c
b/uip/msh.c
index
c2d4e1a
..
b3aa3a1
100644
(file)
--- a/
uip/msh.c
+++ b/
uip/msh.c
@@
-22,15
+22,7
@@
#include <h/mts.h>
#include <h/utils.h>
#include <h/mts.h>
#include <h/utils.h>
-#ifdef HAVE_TERMIOS_H
-# include <termios.h>
-#else
-# ifdef HAVE_TERMIO_H
-# include <termio.h>
-# else
-# include <sgtty.h>
-# endif
-#endif
+#include <termios.h>
#include <pwd.h>
#include <setjmp.h>
#include <pwd.h>
#include <setjmp.h>
@@
-158,19
+150,11
@@
int interrupted; /* SIGINT detected */
int broken_pipe; /* SIGPIPE detected */
int told_to_quit; /* SIGQUIT detected */
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
*/
/*
* prototypes
*/
-int SOprintf (char *, ...); /* from termsbr.c */
-int sc_width (void); /* from termsbr.c */
void fsetup (char *);
void setup (char *);
void fsetup (char *);
void setup (char *);
-FILE *msh_ready (int, int);
void readids (int);
int readid (int);
void display_info (int);
void readids (int);
int readid (int);
void display_info (int);
@@
-189,7
+173,6
@@
static int read_map (char *, long);
static int read_file (long, int);
static void m_gMsgs (int);
static int read_file (long, int);
static void m_gMsgs (int);
-FILE *msh_ready (int, int);
static int check_folder (int);
static void scanrange (int, int);
static void scanstring (char *);
static int check_folder (int);
static void scanrange (int, int);
static void scanstring (char *);
@@
-203,10
+186,10
@@
static int initaux_io (struct Cmd *);
static void fin_io (struct Cmd *, int);
static void finaux_io (struct Cmd *);
static void m_init (void);
static void fin_io (struct Cmd *, int);
static void finaux_io (struct Cmd *);
static void m_init (void);
-static RETSIGTYPE intrser (int);
-static RETSIGTYPE pipeser (int);
-static RETSIGTYPE quitser (int);
-static RETSIGTYPE alrmser (int);
+static void intrser (int);
+static void pipeser (int);
+static void quitser (int);
+static void alrmser (int);
static int pINI (void);
static int pQRY (char *, int);
static int pQRY1 (int);
static int pINI (void);
static int pQRY (char *, int);
static int pQRY1 (int);
@@
-252,10
+235,10
@@
main (int argc, char **argv)
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
print_help (buf, switches, 1);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
print_help (buf, switches, 1);
- done (1);
+ done (0);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
- done (1);
+ done (0);
case IDSW:
if (!(cp = *argp++) || *cp == '-')
case IDSW:
if (!(cp = *argp++) || *cp == '-')
@@
-344,9
+327,6
@@
main (int argc, char **argv)
ioctl (pfd, FIOCLEX, NULL);
#endif /* FIOCLEX */
ioctl (pfd, FIOCLEX, NULL);
#endif /* FIOCLEX */
-#ifdef BSD42
- should_intr = 0;
-#endif /* BSD42 */
istat = SIGNAL2 (SIGINT, intrser);
qstat = SIGNAL2 (SIGQUIT, quitser);
istat = SIGNAL2 (SIGINT, intrser);
qstat = SIGNAL2 (SIGQUIT, quitser);
@@
-824,6
+804,7
@@
msh_ready (int msgnum, int full)
register int msgp;
int fd;
char *cp;
register int msgp;
int fd;
char *cp;
+ NMH_UNUSED (full);
if (yp) {
fclose (yp);
if (yp) {
fclose (yp);
@@
-1062,11
+1043,9
@@
display_info (int scansw)
if (sp == NULL) {
if ((sd = dup (fileno (stdout))) == NOTOK)
padios ("standard output", "unable to dup");
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 */
#ifdef FIOCLEX
ioctl (sd, FIOCLEX, NULL);
#endif /* FIOCLEX */
-#endif /* not BSD42 */
if ((sp = fdopen (sd, "w")) == NULL)
padios ("standard output", "unable to fdopen");
}
if ((sp = fdopen (sd, "w")) == NULL)
padios ("standard output", "unable to fdopen");
}
@@
-1224,33
+1203,11
@@
getargs (char *prompt, struct swit *sw, struct Cmd *cmdp)
told_to_quit = 0;
for (;;) {
interrupted = 0;
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';) {
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');
if (interrupted && !told_to_quit) {
buffer[0] = '\0';
putchar ('\n');
@@
-1265,10
+1222,6
@@
getargs (char *prompt, struct swit *sw, struct Cmd *cmdp)
#endif
return EOF;
}
#endif
return EOF;
}
-#else /* BSD42 */
- if (i == EOF)
- longjmp (sigenv, DONE);
-#endif /* BSD42 */
if (cp < &buffer[sizeof buffer - 2])
*cp++ = i;
}
if (cp < &buffer[sizeof buffer - 2])
*cp++ = i;
}
@@
-1296,9
+1249,6
@@
getargs (char *prompt, struct swit *sw, struct Cmd *cmdp)
cmdp->args[0]);
continue;
default:
cmdp->args[0]);
continue;
default:
-#ifdef BSD42
- should_intr = 0;
-#endif /* BSD42 */
return i;
}
}
return i;
}
}
@@
-1626,62
+1576,39
@@
seq_setcur (struct msgs *mp, int msgnum)
-static RETSIGTYPE
+static void
intrser (int i)
{
intrser (int i)
{
-#ifndef RELIABLE_SIGNALS
- SIGNAL (SIGINT, intrser);
-#endif
-
+ NMH_UNUSED (i);
discard (stdout);
interrupted++;
discard (stdout);
interrupted++;
-
-#ifdef BSD42
- if (should_intr)
- longjmp (sigenv, NOTOK);
-#endif
}
}
-static RETSIGTYPE
+static void
pipeser (int i)
{
pipeser (int i)
{
-#ifndef RELIABLE_SIGNALS
- SIGNAL (SIGPIPE, pipeser);
-#endif
-
+ NMH_UNUSED (i);
if (broken_pipe++ == 0)
fprintf (stderr, "broken pipe\n");
told_to_quit++;
interrupted++;
if (broken_pipe++ == 0)
fprintf (stderr, "broken pipe\n");
told_to_quit++;
interrupted++;
-
-#ifdef BSD42
- if (should_intr)
- longjmp (sigenv, NOTOK);
-#endif
}
}
-static RETSIGTYPE
+static void
quitser (int i)
{
quitser (int i)
{
-#ifndef RELIABLE_SIGNALS
- SIGNAL (SIGQUIT, quitser);
-#endif
-
+ NMH_UNUSED (i);
told_to_quit++;
interrupted++;
told_to_quit++;
interrupted++;
-
-#ifdef BSD42
- if (should_intr)
- longjmp (sigenv, NOTOK);
-#endif
}
}
-static RETSIGTYPE
+static void
alrmser (int i)
{
alrmser (int i)
{
+ NMH_UNUSED (i);
longjmp (peerenv, DONE);
}
longjmp (peerenv, DONE);
}
@@
-1746,6
+1673,7
@@
pINI (void)
static int
pQRY (char *str, int scansw)
{
static int
pQRY (char *str, int scansw)
{
+ NMH_UNUSED (str);
if (pQRY1 (scansw) == NOTOK || pQRY2 () == NOTOK)
return NOTOK;
if (pQRY1 (scansw) == NOTOK || pQRY2 () == NOTOK)
return NOTOK;