From dc23eaf3310218404301a5e5df00bd303de0bde7 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 1 Feb 2000 00:00:02 +0000 Subject: Debian buglist cleanup. svn path=/trunk/; revision=2727 --- fetchmail.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index c6b2e72f..27054b1d 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -574,7 +574,8 @@ int main(int argc, char **argv) signal(SIGQUIT, terminate_run); /* here's the exclusion lock */ - if ((st = open(lockfile, O_WRONLY | O_CREAT | O_EXCL, 0666)) != -1) { + if ((st = open(lockfile, O_WRONLY|O_CREAT|O_EXCL|O_SYNC, 0666)) != -1) + { sprintf(tmpbuf,"%d", getpid()); write(st, tmpbuf, strlen(tmpbuf)); if (run.poll_interval) @@ -582,7 +583,7 @@ int main(int argc, char **argv) sprintf(tmpbuf," %d", run.poll_interval); write(st, tmpbuf, strlen(tmpbuf)); } - close(st); /* should be safe, previous write was atomic */ + close(st); /* should be safe, fd was opened with O_SYNC */ lock_acquired = TRUE; } -- cgit v1.2.3