diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2005-01-27 18:34:27 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2005-01-27 18:34:27 +0000 |
commit | 9b932b85f48006f22d93ec43e841b7c640a7dd78 (patch) | |
tree | 8a169a7b391ede6dbda570964cbfc621f6991c6e | |
parent | fc77c9b7fcaea53db9f012d31e1a806b99a952e8 (diff) |
since we close the handles to Entries files, we must reopen them to add
the directories when receiving a Clear-sticky or Set-sticky response.
spotted by Joris Vink
-rw-r--r-- | usr.bin/cvs/resp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c index ffd32c06bea..12a29d818f1 100644 --- a/usr.bin/cvs/resp.c +++ b/usr.bin/cvs/resp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resp.c,v 1.20 2005/01/13 05:39:07 jfb Exp $ */ +/* $OpenBSD: resp.c,v 1.21 2005/01/27 18:34:26 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -364,6 +364,7 @@ cvs_resp_sticky(struct cvsroot *root, int type, char *line) char buf[MAXPATHLEN], subdir[MAXPATHLEN], *file; struct cvs_ent *ent; CVSFILE *cf, *sdir; + CVSENTRIES *entf; /* get the remote path */ if (cvs_getln(root, buf, sizeof(buf)) < 0) @@ -396,7 +397,7 @@ cvs_resp_sticky(struct cvsroot *root, int type, char *line) cvs_file_attach(sdir, cf); /* add a directory entry to the parent */ - if (CVS_DIR_ENTRIES(sdir) != NULL) { + if ((entf = cvs_ent_open(subdir, O_WRONLY)) != NULL) { snprintf(buf, sizeof(buf), "D/%s////", CVS_FILE_NAME(cf)); ent = cvs_ent_parse(buf); @@ -404,7 +405,8 @@ cvs_resp_sticky(struct cvsroot *root, int type, char *line) cvs_log(LP_ERR, "failed to create directory entry"); else - cvs_ent_add(CVS_DIR_ENTRIES(sdir), ent); + cvs_ent_add(entf, ent); + cvs_ent_close(entf); } } |