** complete copyright information.
*/
-#include <h/nmh.h>
-#include <h/utils.h>
-
#include <h/mh.h>
+#include <h/utils.h>
#include <h/dropsbr.h>
#include <h/tws.h>
-
-#ifdef HAVE_ERRNO_H
-# include <errno.h>
-#endif
-
+#include <errno.h>
#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
/*
** a file or maildrop.
*/
int
-mbx_open(char *file, uid_t uid, gid_t gid, mode_t mode)
+mbox_open(char *file, uid_t uid, gid_t gid, mode_t mode)
{
int i, count, fd;
struct stat st;
#endif
case ETXTBSY:
i = errno;
- sleep(5);
- break;
+ sleep(1);
+ continue;
default:
/* just return error */
** Append message to end of mbox.
*/
int
-mbx_copy(int to, int from)
+mbox_copy(int to, int from)
{
int i;
char buffer[BUFSIZ];
if (i != 0 && strncmp(buffer, "From ", 5) == 0) {
write(to, ">", 1);
}
- if (write(to, buffer, strlen(buffer)) != strlen(buffer)) {
+ if (write(to, buffer, strlen(buffer)) != (int)strlen(buffer)) {
fclose(fp);
return NOTOK;
}
** Close and unlock file/maildrop.
*/
int
-mbx_close(char *mailbox, int md)
+mbox_close(char *mailbox, int md)
{
if (lkclose(md, mailbox) == 0)
return OK;