X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/fe4026749648d3f5693adce7ae7a218968a9beb5..a3724ed39:/uip/slocal.c?ds=sidebyside diff --git a/uip/slocal.c b/uip/slocal.c index 4174d4a0..97897ad1 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -27,6 +27,8 @@ #include #include #include +#include "../sbr/lock_file.h" +#include "../sbr/m_mktemp.h" #include #include @@ -969,19 +971,11 @@ timely (char *t1, char *t2) static int usr_file (int fd, char *mailbox, int mbx_style) { - int md, mapping; + int md; - if (verbose) - verbose_printf ("delivering to file \"%s\"", mailbox); - - if (mbx_style == MBOX_FORMAT) { - if (verbose) - verbose_printf (" (mbox style)"); - mapping = 0; - } else { - if (verbose) - verbose_printf (" (mmdf style)"); - mapping = 1; + if (verbose) { + verbose_printf("delivering to file \"%s\" (%s style)", mailbox, + mbx_style == MBOX_FORMAT ? "mbox" : "mmdf"); } /* open and lock the file */ @@ -991,10 +985,10 @@ usr_file (int fd, char *mailbox, int mbx_style) return -1; } - lseek (fd, (off_t) 0, SEEK_SET); + lseek(fd, 0, SEEK_SET); /* append message to file */ - if (mbx_copy (mailbox, mbx_style, md, fd, mapping, NULL, verbose) == -1) { + if (mbx_copy (mailbox, mbx_style, md, fd, NULL) == -1) { if (verbose) adorn ("", "error writing to:"); return -1; @@ -1057,7 +1051,7 @@ usr_pipe (int fd_arg, char *cmd, char *pgm, char **vec, int suppress) if (verbose && !suppress) verbose_printf ("delivering to pipe \"%s\"", cmd); - lseek (fd, (off_t) 0, SEEK_SET); + lseek(fd, 0, SEEK_SET); for (i = 0; (child_id = fork()) == -1 && i < 5; i++) sleep (5); @@ -1218,7 +1212,7 @@ you_lose: } if (i == -1) goto you_lose; - lseek (fd1, (off_t) 0, SEEK_SET); + lseek(fd1, 0, SEEK_SET); return fd1; } @@ -1283,7 +1277,7 @@ you_lose: return -1; } fclose (qfp); - lseek (fd1, (off_t) 0, SEEK_SET); + lseek(fd1, 0, SEEK_SET); return fd1;