diff options
author | 2006-06-14 14:10:50 +0000 | |
---|---|---|
committer | 2006-06-14 14:10:50 +0000 | |
commit | f2a4882a35550b6177c6fdd6c36761bd8d117099 (patch) | |
tree | 9ad6cecba576dc5497a252d1c80491f0c1daea82 /usr.bin/cvs/diff3.c | |
parent | indentation. (diff) | |
download | wireguard-openbsd-f2a4882a35550b6177c6fdd6c36761bd8d117099.tar.xz wireguard-openbsd-f2a4882a35550b6177c6fdd6c36761bd8d117099.zip |
add cvs_buf_load_fd() which does the same as cvs_buf_load()
except it takes a decriptor as argument instead of a path.
modified cvs_buf_load() to open the descriptor then pass
it to cvs_buf_load_fd().
change all the calls to cvs_buf_load() that have a descriptor
open for the path to cvs_buf_load_fd() to prevent races.
Diffstat (limited to 'usr.bin/cvs/diff3.c')
-rw-r--r-- | usr.bin/cvs/diff3.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c index 16a7657fd7d..8a16d4cffc3 100644 --- a/usr.bin/cvs/diff3.c +++ b/usr.bin/cvs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.24 2006/05/27 03:30:30 joris Exp $ */ +/* $OpenBSD: diff3.c,v 1.25 2006/06/14 14:10:50 joris 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.24 2006/05/27 03:30:30 joris Exp $"; + "$OpenBSD: diff3.c,v 1.25 2006/06/14 14:10:50 joris Exp $"; #endif /* not lint */ #include "includes.h" @@ -155,7 +155,8 @@ static int diff3_internal(int, char **, const char *, const char *); int diff3_conflicts = 0; BUF * -cvs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2, int verbose) +cvs_diff3(RCSFILE *rf, char *workfile, int workfd, RCSNUM *rev1, + RCSNUM *rev2, int verbose) { int argc; char *data, *patch; @@ -169,7 +170,7 @@ cvs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2, int verbose) rcsnum_tostr(rev1, r1, sizeof(r1)); rcsnum_tostr(rev2, r2, sizeof(r2)); - if ((b1 = cvs_buf_load(workfile, BUF_AUTOEXT)) == NULL) + if ((b1 = cvs_buf_load_fd(workfd, BUF_AUTOEXT)) == NULL) goto out; if (verbose == 1) |