#include <h/tws.h>
#include <h/mts.h>
#include <h/utils.h>
+#include "../sbr/lock_file.h"
+#include "../sbr/m_mktemp.h"
#include <pwd.h>
#include <sys/ioctl.h>
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 */
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;
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);
}
if (i == -1)
goto you_lose;
- lseek (fd1, (off_t) 0, SEEK_SET);
+ lseek(fd1, 0, SEEK_SET);
return fd1;
}
return -1;
}
fclose (qfp);
- lseek (fd1, (off_t) 0, SEEK_SET);
+ lseek(fd1, 0, SEEK_SET);
return fd1;