summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/diff3.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2007-09-17 10:07:22 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2007-09-17 10:07:22 +0000
commitee89fbc00a9f91fdcac93f7160e2cc914f366667 (patch)
tree442f0130a0647a118f5c7eeb663782998fff3969 /usr.bin/cvs/diff3.c
parent891e3cba41e94abdf1f7f1f46df1b9a9c4e77f1c (diff)
Imported atomicio interface.
Requested by ray@, OK joris@
Diffstat (limited to 'usr.bin/cvs/diff3.c')
-rw-r--r--usr.bin/cvs/diff3.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c
index 3f05e815907..9c811594429 100644
--- a/usr.bin/cvs/diff3.c
+++ b/usr.bin/cvs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.38 2007/09/10 14:29:53 tobias Exp $ */
+/* $OpenBSD: diff3.c,v 1.39 2007/09/17 10:07:21 tobias Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -72,7 +72,7 @@ static const char copyright[] =
#ifndef lint
static const char rcsid[] =
- "$OpenBSD: diff3.c,v 1.38 2007/09/10 14:29:53 tobias Exp $";
+ "$OpenBSD: diff3.c,v 1.39 2007/09/17 10:07:21 tobias Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -83,6 +83,7 @@ static const char rcsid[] =
#include <string.h>
#include <unistd.h>
+#include "atomicio.h"
#include "cvs.h"
#include "diff.h"
@@ -245,7 +246,8 @@ cvs_merge_file(struct cvs_file *cf, int verbose)
if (lp->l_line == NULL)
continue;
- if (write(cf->fd, lp->l_line, lp->l_len) == -1)
+ if (atomicio(vwrite, cf->fd, lp->l_line, lp->l_len) !=
+ lp->l_len)
fatal("cvs_merge_file: %s", strerror(errno));
}