76 #define MILLION 1000000
90 for (count = 1; ; count++) {
97 if ((fd = open(lock_file, O_WRONLY | O_EXCL | O_CREAT, 0)) >= 0) {
116 if (
stat(lock_file, &st) == 0)
118 if (unlink(lock_file) < 0)
136 int saved_errno = errno;
138 lock_file =
concatenate(path,
".lock", (
char *) 0);
139 (void) unlink(lock_file);
158 int main(
int argc,
char **argv)
164 msg_fatal(
"usage: %s file-to-be-locked", argv[0]);
int main(int argc, char **argv)
void dot_unlockfile(const char *path)
void mail_conf_read(void)
int dot_lockfile(const char *path, VSTRING *why)
VSTRING * vstring_alloc(ssize_t len)
VSTRING * vstring_sprintf(VSTRING *vp, const char *format,...)
NORETURN msg_fatal(const char *fmt,...)
void rand_sleep(unsigned, unsigned)
char * concatenate(const char *arg0,...)
VSTRING * vstring_free(VSTRING *vp)
void msg_vstream_init(const char *name, VSTREAM *vp)