summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-05-24 07:33:37 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-05-24 07:33:37 +0000
commitdefc1d429d912cb82dab74a99b9abb8721c399e0 (patch)
tree7fb1d79413fe098fefc85158e974a1c2eb03cd43 /usr.bin
parent7094355a7228677dd694f939dae503223697ed0c (diff)
don't try to create directories with mkdir(2) in cvs_resp_sticky().
it will already be created with cvs_file_create(). fixes the Clear-sticky and Set-sticky responses.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/resp.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c
index d18e85bdb4d..9ff1ca759b0 100644
--- a/usr.bin/cvs/resp.c
+++ b/usr.bin/cvs/resp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: resp.c,v 1.37 2005/05/24 04:12:25 jfb Exp $ */
+/* $OpenBSD: resp.c,v 1.38 2005/05/24 07:33:36 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -343,7 +343,7 @@ cvs_resp_statdir(struct cvsroot *root, int type, char *line)
/* if the directory doesn't exist, first create it */
if ((stat(line, &dst) == -1) && (errno == ENOENT)) {
- if (mkdir(line, 0755) == -1) {
+ if ((mkdir(line, 0755) == -1) && (errno != ENOENT)) {
cvs_log(LP_ERRNO, "failed to create %s", line);
return (-1);
}
@@ -391,7 +391,6 @@ cvs_resp_sticky(struct cvsroot *root, int type, char *line)
{
char buf[MAXPATHLEN], subdir[MAXPATHLEN], *file;
struct cvs_ent *ent;
- struct stat dst;
CVSFILE *cf, *sdir;
CVSENTRIES *entf;
@@ -401,14 +400,6 @@ cvs_resp_sticky(struct cvsroot *root, int type, char *line)
STRIP_SLASH(line);
- /* if the directory doesn't exist, first create it */
- if ((stat(line, &dst) == -1) && (errno == ENOENT)) {
- if (mkdir(line, 0755) == -1) {
- cvs_log(LP_ERRNO, "failed to create %s", line);
- return (-1);
- }
- }
-
cvs_splitpath(line, subdir, sizeof(subdir), &file);
sdir = cvs_file_find(cvs_files, subdir);
if (sdir == NULL) {
@@ -420,8 +411,10 @@ cvs_resp_sticky(struct cvsroot *root, int type, char *line)
if (cf == NULL) {
/* attempt to create it */
cf = cvs_file_create(sdir, line, DT_DIR, 0755);
- if (cf == NULL)
+ if (cf == NULL) {
+ printf("yeah its this man\n");
return (-1);
+ }
cf->cf_repo = strdup(line);
if (cf->cf_repo == NULL) {
cvs_log(LP_ERRNO, "failed to duplicate `%s'", line);