X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/58c5e5b287f2ef7b6a855b30eb0c2be1edd5ab42..edcc7ae1dc9a6e30e9454da7cf0c093f4852b7ea:/uip/inc.c diff --git a/uip/inc.c b/uip/inc.c index 68fb06b6..e824ea37 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -40,9 +40,10 @@ #include #include #include -#include "../sbr/lock_file.h" -#include "../sbr/m_maildir.h" -#include "../sbr/m_mktemp.h" +#include "h/done.h" +#include "sbr/lock_file.h" +#include "sbr/m_maildir.h" +#include "sbr/m_mktemp.h" #ifndef TLS_SUPPORT # define TLSminc(a) (a) @@ -149,17 +150,18 @@ static gid_t return_gid; #endif /* not MAILGROUP */ /* these variables have to be globals so that done() can correctly clean up the lockfile */ -static int locked = 0; +static bool locked; static char *newmail; static FILE *in; /* * prototypes */ +static int maildir_srt(const void *va, const void *vb) PURE; static void inc_done(int) NORETURN; static int pop_action(void *closure, char *); -int +static int maildir_srt(const void *va, const void *vb) { const struct Maildir_entry *a = va, *b = vb; @@ -195,7 +197,7 @@ main (int argc, char **argv) int nmsgs, nbytes; char *MAILHOST_env_variable; - done=inc_done; + set_done(inc_done); /* absolutely the first thing we do is save our privileges, * and drop them if we can. @@ -376,8 +378,7 @@ main (int argc, char **argv) if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); - else - folder = pluspath (cp); + folder = pluspath (cp); } else { adios (NULL, "usage: %s [+folder] [switches]", invo_name); } @@ -526,7 +527,7 @@ main (int argc, char **argv) /* Mail from a spool file. */ if (access (newmail, W_OK) != NOTOK) { - locked++; + locked = true; if (trnflag) { SIGNAL (SIGHUP, SIG_IGN); SIGNAL (SIGINT, SIG_IGN); @@ -556,7 +557,7 @@ main (int argc, char **argv) inform("Creating Receive-Audit: %s", audfile); if ((aud = fopen (audfile, "a")) == NULL) adios (audfile, "unable to append to"); - else if (i == NOTOK) + if (i == NOTOK) chmod (audfile, m_gmprot ()); if (from) @@ -907,7 +908,7 @@ skip: static void NORETURN inc_done (int status) { - done = exit; + set_done(exit); if (locked) { GETGROUPPRIVS();