(*done)(). This should make changing the return type of done and the
rationalisation of exit code easier.
15 files changed:
extern char *whatnowproc;
extern char *whomproc;
extern char *whatnowproc;
extern char *whomproc;
+extern int (*done) (int);
+
#include <h/prototypes.h>
#include <h/prototypes.h>
void cpydgst (int, int, char *, char *);
int decode_rfc2047 (char *, char *, size_t);
void discard (FILE *);
void cpydgst (int, int, char *, char *);
int decode_rfc2047 (char *, char *, size_t);
void discard (FILE *);
int ext_hook(char *, char *, char *);
int fdcompare (int, int);
int folder_addmsg (struct msgs **, char *, int, int, int, int, char *);
int ext_hook(char *, char *, char *);
int fdcompare (int, int);
int folder_addmsg (struct msgs **, char *, int, int, int, int, char *);
+int (*done) (int) = default_done;
+
+default_done (int status)
{
exit (status);
return 1; /* dead code to satisfy the compiler */
{
exit (status);
return 1; /* dead code to satisfy the compiler */
*/
char *map_name(char *);
*/
char *map_name(char *);
+static int inc_done(int);
static int pop_action(char *);
static int pop_pack(char *);
static int map_count(void);
static int pop_action(char *);
static int pop_pack(char *);
static int map_count(void);
struct hes_postoffice *po;
#endif
struct hes_postoffice *po;
#endif
/* absolutely the first thing we do is save our privileges,
* and drop them if we can.
*/
/* absolutely the first thing we do is save our privileges,
* and drop them if we can.
*/
+static int
+inc_done (int status)
{
#ifdef POP
if (packfile && pd != NOTOK)
{
#ifdef POP
if (packfile && pd != NOTOK)
static char outfile[BUFSIZ];
static int unlink_outfile = 0;
static char outfile[BUFSIZ];
static int unlink_outfile = 0;
+static int unlink_done (int);
/* mhbuildsbr.c */
CT build_mime (char *);
/* mhbuildsbr.c */
CT build_mime (char *);
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
+static int
+unlink_done (int status)
{
/*
* Check if we need to remove stray
{
/*
* Check if we need to remove stray
* static prototypes
*/
static RETSIGTYPE pipeser (int);
* static prototypes
*/
static RETSIGTYPE pipeser (int);
+static int freectp_done (int);
struct msgs *mp = NULL;
CT ct, *ctp;
struct msgs *mp = NULL;
CT ct, *ctp;
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
+static int
+freectp_done (int status)
* static prototypes
*/
static RETSIGTYPE pipeser (int);
* static prototypes
*/
static RETSIGTYPE pipeser (int);
+static int freectp_done (int);
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
+static int
+freectp_done (int status)
* static prototypes
*/
static RETSIGTYPE pipeser (int);
* static prototypes
*/
static RETSIGTYPE pipeser (int);
+static int freectp_done (int);
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
+static int
+freectp_done (int status)
* static prototypes
*/
static RETSIGTYPE pipeser (int);
* static prototypes
*/
static RETSIGTYPE pipeser (int);
+static int freectp_done (int);
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
+static int
+freectp_done (int status)
*/
static int write_content (CT *, char *);
static RETSIGTYPE pipeser (int);
*/
static int write_content (CT *, char *);
static RETSIGTYPE pipeser (int);
+static int freectp_done (int);
struct msgs *mp = NULL;
CT ct, *ctp;
struct msgs *mp = NULL;
CT ct, *ctp;
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
+static int
+freectp_done (int status)
static int mbx_style = MBOX_FORMAT;
static int mapping = 0;
static int mbx_style = MBOX_FORMAT;
static int mapping = 0;
+static int mbxclose_done(int);
+
struct msgs *mp;
struct stat st;
struct msgs *mp;
struct stat st;
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
+static int
+mbxclose_done (int status)
{
mbx_close (file, md);
exit (status);
{
mbx_close (file, md);
exit (status);
+static int putzero_done (int);
int
main (int argc, char **argv)
int
main (int argc, char **argv)
struct msgs *mp;
register FILE *fp;
struct msgs *mp;
register FILE *fp;
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
+static int
+putzero_done (int status)
{
if (listsw && status && !isatty (fileno (stdout)))
printf ("0\n");
{
if (listsw && status && !isatty (fileno (stdout)))
printf ("0\n");
* prototypes
*/
static void rcvdistout (FILE *, char *, char *);
* prototypes
*/
static void rcvdistout (FILE *, char *, char *);
+static int unlink_done (int);
char **argp, **arguments, *vec[MAXARGS];
register FILE *fp;
char **argp, **arguments, *vec[MAXARGS];
register FILE *fp;
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
+static int
+unlink_done (int status)
{
if (backup[0])
unlink (backup);
{
if (backup[0])
unlink (backup);
*/
static char *tmpfilenam = NULL;
*/
static char *tmpfilenam = NULL;
+static int unlink_done(int);
int
main (int argc, char **argv)
int
main (int argc, char **argv)
struct msgs *mp;
struct stat st;
struct msgs *mp;
struct stat st;
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
#ifdef LOCALE
setlocale(LC_ALL, "");
#endif
/*
* Clean up and exit
*/
/*
* Clean up and exit
*/
+static int
+unlink_done(int status)
{
if (tmpfilenam && *tmpfilenam)
unlink (tmpfilenam);
{
if (tmpfilenam && *tmpfilenam)
unlink (tmpfilenam);
char *annotext = NULL;
char *distfile = NULL;
char *annotext = NULL;
char *distfile = NULL;
static jmp_buf env;
static char body_file_name[MAXPATHLEN + 1]; /* name of temporary file for body content */
static jmp_buf env;
static char body_file_name[MAXPATHLEN + 1]; /* name of temporary file for body content */
* external prototypes
*/
int sendsbr (char **, int, char *, struct stat *, int, char *, int);
* external prototypes
*/
int sendsbr (char **, int, char *, struct stat *, int, char *, int);
char *getusername (void);
/*
* static prototypes
*/
char *getusername (void);
/*
* static prototypes
*/
+static int armed_done (int);
static void alert (char *, int);
static int tmp_fd (void);
static void anno (int, struct stat *);
static void alert (char *, int);
static int tmp_fd (void);
static void anno (int, struct stat *);
switch (setjmp (env)) {
case OK:
/*
switch (setjmp (env)) {
case OK:
/*
if (distfile)
unlink (distfile);
if (distfile)
unlink (distfile);
+static int
+armed_done (int status)
- if (armed)
- longjmp (env, status ? status : NOTOK);
+ longjmp (env, status ? status : NOTOK);
exit (status);
return 1; /* dead code to satisfy the compiler */
exit (status);
return 1; /* dead code to satisfy the compiler */