From e9ae30055e13c90e6dce2d22d2c5a603c652623f Mon Sep 17 00:00:00 2001 From: Xavier Santolaria Date: Fri, 5 Jan 2007 09:41:31 +0000 Subject: for edit: create the CVS/Base directory if it does not already exist. --- usr.bin/cvs/edit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.bin/cvs/edit.c b/usr.bin/cvs/edit.c index c99e6bc5c85..64e703d9259 100644 --- a/usr.bin/cvs/edit.c +++ b/usr.bin/cvs/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.21 2007/01/05 09:32:49 xsa Exp $ */ +/* $OpenBSD: edit.c,v 1.22 2007/01/05 09:41:30 xsa Exp $ */ /* * Copyright (c) 2006, 2007 Xavier Santolaria * @@ -289,6 +289,10 @@ cvs_edit_local(struct cvs_file *cf) MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_edit_local: truncation"); + if (mkdir(CVS_PATH_BASEDIR, 0755) == -1 && errno != EEXIST) + fatal("cvs_edit_local: `%s': %s", CVS_PATH_BASEDIR, + strerror(errno)); + /* XXX: copy cf->file_path to bfpath */ xfree(bfpath); -- cgit v1.2.3