diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-07-14 04:32:43 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-07-14 04:32:43 +0000 |
commit | e50948c9306a05c3b76b19bf20e0921b2fe4112e (patch) | |
tree | ea787e5a736911d768d52ae954100e197f9e3cf7 | |
parent | 5aa981b28e91c86c90f78babe6c3a32effc92e72 (diff) |
prepare the entries interface so we can add entries
-rw-r--r-- | usr.bin/cvs/cvs.h | 5 | ||||
-rw-r--r-- | usr.bin/cvs/diff.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/entries.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/proto.c | 9 |
4 files changed, 11 insertions, 13 deletions
diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index dff9c9f95ce..73240386801 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.2 2004/07/14 03:33:09 jfb Exp $ */ +/* $OpenBSD: cvs.h,v 1.3 2004/07/14 04:32:42 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -262,6 +262,7 @@ struct cvs_ent { typedef struct cvs_entries { char *cef_path; + FILE *cef_file; u_int cef_nid; /* next entry index to return for next() */ @@ -354,7 +355,7 @@ void cvs_file_free (char **, int); /* Entries API */ -CVSENTRIES* cvs_ent_open (const char *); +CVSENTRIES* cvs_ent_open (const char *, int); struct cvs_ent* cvs_ent_get (CVSENTRIES *, const char *); struct cvs_ent* cvs_ent_next (CVSENTRIES *); int cvs_ent_add (CVSENTRIES *, struct cvs_ent *); diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index 68d35cc97e3..e56f0eab74d 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.2 2004/07/14 03:59:36 jfb Exp $ */ +/* $OpenBSD: diff.c,v 1.3 2004/07/14 04:32:42 jfb Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -510,7 +510,7 @@ cvs_diff_file(const char *path, const char *rev1, const char *rev2) cvs_splitpath(path, dir, sizeof(dir), file, sizeof(file)); cvs_readrepo(dir, repo, sizeof(repo)); - entf = cvs_ent_open(dir); + entf = cvs_ent_open(dir, O_RDONLY); if (entf == NULL) { cvs_log(LP_ERR, "no CVS/Entries file in `%s'", dir); return (-1); @@ -621,7 +621,7 @@ cvs_diff_dir(const char *dir, int recurse) return (-1); } - entf = cvs_ent_open(dir); + entf = cvs_ent_open(dir, O_RDONLY); if (entf == NULL) { cvs_log(LP_ERR, "no CVS/Entries file in `%s'", dir); (void)closedir(dirp); diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 033eb59518e..18cfcb20b97 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.1 2004/07/13 22:02:40 jfb Exp $ */ +/* $OpenBSD: entries.c,v 1.2 2004/07/14 04:32:42 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -50,7 +50,7 @@ */ CVSENTRIES* -cvs_ent_open(const char *dir) +cvs_ent_open(const char *dir, int flags) { size_t len; char entpath[MAXPATHLEN], ebuf[128]; diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c index e5e23cdc6e2..96bd31ac0f7 100644 --- a/usr.bin/cvs/proto.c +++ b/usr.bin/cvs/proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.c,v 1.1 2004/07/13 22:02:40 jfb Exp $ */ +/* $OpenBSD: proto.c,v 1.2 2004/07/14 04:32:42 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -585,10 +585,7 @@ cvs_resp_newentry(int type, char *line) struct cvs_ent *entp; CVSENTRIES *entfile; - if (cvs_splitpath(line, entbuf, sizeof(entbuf), NULL, 0) < 0) - return (-1); - - snprintf(path, sizeof(path), "%s/" CVS_PATH_ENTRIES, entbuf); + snprintf(path, sizeof(path), "%s/" CVS_PATH_ENTRIES, line); /* get the remote path */ cvs_client_getln(entbuf, sizeof(entbuf)); @@ -601,7 +598,7 @@ cvs_resp_newentry(int type, char *line) if (entp == NULL) return (-1); - entfile = cvs_ent_open(path); + entfile = cvs_ent_open(path, O_WRONLY); if (entfile == NULL) return (-1); |