From bb59aecc3f6eb89a9091d6bc56d8f11c50fa3b65 Mon Sep 17 00:00:00 2001 From: tobias Date: Mon, 17 Sep 2007 10:07:21 +0000 Subject: Imported atomicio interface. Requested by ray@, OK joris@ --- usr.bin/cvs/diff3.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'usr.bin/cvs/diff3.c') 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 @@ -83,6 +83,7 @@ static const char rcsid[] = #include #include +#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)); } -- cgit v1.2.3-59-g8ed1b