summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-05-01 23:21:40 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-05-01 23:21:40 +0000
commit5504d0a8ea4485658c4a709aa5907dab61f8be31 (patch)
tree1ebc7307ef927c552ed7117f240a3d68d4afbe3c /usr.bin
parent713e5fb73f68756e9fbbfeadc75a58b3e7194f5f (diff)
if CF_MKADMIN flag is specified the administrative files will
be created (if missing) in cvs_load_dirinfo().
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/file.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index 384990974e7..5032c5cccae 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.68 2005/04/25 21:58:32 joris Exp $ */
+/* $OpenBSD: file.c,v 1.69 2005/05/01 23:21:39 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -107,7 +107,7 @@ static RCSNUM *cvs_addedrev;
TAILQ_HEAD(, cvs_ignpat) cvs_ign_pats;
-static int cvs_load_dirinfo (CVSFILE *);
+static int cvs_load_dirinfo (CVSFILE *, int);
static int cvs_file_getdir (CVSFILE *, int, char *);
static int cvs_file_sort (struct cvs_flist *, u_int);
static int cvs_file_cmp (const void *, const void *);
@@ -544,7 +544,7 @@ cvs_file_attach(CVSFILE *parent, CVSFILE *file)
* Load directory information
*/
static int
-cvs_load_dirinfo(CVSFILE *cf)
+cvs_load_dirinfo(CVSFILE *cf, int flags)
{
char fpath[MAXPATHLEN];
char pbuf[MAXPATHLEN];
@@ -557,6 +557,9 @@ cvs_load_dirinfo(CVSFILE *cf)
return (-1);
if (cf->cf_cvstat != CVS_FST_UNKNOWN) {
+ if (flags & CF_MKADMIN)
+ cvs_mkadmin(cf, 0755);
+
/* if the CVS administrative directory exists, load the info */
l = snprintf(pbuf, sizeof(pbuf), "%s/" CVS_PATH_CVSDIR, fpath);
if (l == -1 || l >= (int)sizeof(pbuf)) {
@@ -1011,7 +1014,7 @@ cvs_file_lget(const char *path, int flags, CVSFILE *parent, struct cvs_ent *ent)
ent->ce_rev = NULL;
}
- if ((cfp->cf_type == DT_DIR) && (cvs_load_dirinfo(cfp) < 0)) {
+ if ((cfp->cf_type == DT_DIR) && (cvs_load_dirinfo(cfp, flags) < 0)) {
cvs_file_free(cfp);
return (NULL);
}