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/commit.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/commit.c')
-rw-r--r-- | usr.bin/cvs/commit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index bbf588fefb4..d2021d87b9f 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.72 2006/06/13 06:51:32 joris Exp $ */ +/* $OpenBSD: commit.c,v 1.73 2006/06/14 14:10:50 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -245,7 +245,7 @@ cvs_commit_local(struct cvs_file *cf) if (b == NULL) fatal("cvs_commit_local: failed to get HEAD"); } else { - if ((b = cvs_buf_load(cf->file_path, BUF_AUTOEXT)) == NULL) + if ((b = cvs_buf_load_fd(cf->fd, BUF_AUTOEXT)) == NULL) fatal("cvs_commit_local: failed to load file"); } @@ -347,7 +347,7 @@ commit_diff_file(struct cvs_file *cf) if (cf->file_status == FILE_MODIFIED || cf->file_status == FILE_ADDED) { - if ((b1 = cvs_buf_load(cf->file_path, BUF_AUTOEXT)) == NULL) + if ((b1 = cvs_buf_load_fd(cf->fd, BUF_AUTOEXT)) == NULL) fatal("commit_diff_file: failed to load '%s'", cf->file_path); } else { |