+#define _GNU_SOURCE
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define _GNU_SOURCE
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
-#include "brum.h"
-
-#define LOCK_MAX_TRIES 30
+#include "umpf.h"
+#define LOCK_MAX_TRIES 3
gid_t rgid, egid, sgid;
void
usleep(about * 1000000 + myrand * 500000);
}
-static char*
+char*
cat(char* l, char* r)
{
char* res = xmalloc(strlen(l) + strlen (r) + 1);
return fd;
}
-
-int
-main(int argc, char** argv)
-{
- /* FIXME: move somewhere */
- int fd;
- if (argc < 3)
- return 1;
- char* mb = argv[1];
- int is_default_mailbox = atoi(argv[2]);
- save_gids();
- drop_gid();
- fd = open_mailbox(mb, is_default_mailbox);
- printf("%d\n", fd);
- if (fd < 0)
- return 1;
-
- close_mailbox(fd, mb, is_default_mailbox);
-
- return 0;
-}