version 1.29, 2004/08/13 13:28:53 |
version 1.30, 2004/08/27 13:05:55 |
|
|
} |
} |
|
|
cfp->cf_ddat->cd_ent = cvs_ent_open(path, O_RDWR); |
cfp->cf_ddat->cd_ent = cvs_ent_open(path, O_RDWR); |
|
|
} |
} |
else { |
else { |
fd = open(path, O_WRONLY|O_CREAT|O_EXCL, mode); |
fd = open(path, O_WRONLY|O_CREAT|O_EXCL, mode); |
|
|
* cvs_file_getdir() |
* cvs_file_getdir() |
* |
* |
* Get a cvs directory structure for the directory whose path is <dir>. |
* Get a cvs directory structure for the directory whose path is <dir>. |
|
* This function should not free the directory information on error, as this |
|
* is performed by cvs_file_free(). |
*/ |
*/ |
|
|
static int |
static int |
|
|
|
|
if (cf->cf_cvstat != CVS_FST_UNKNOWN) { |
if (cf->cf_cvstat != CVS_FST_UNKNOWN) { |
cdp->cd_root = cvsroot_get(cf->cf_path); |
cdp->cd_root = cvsroot_get(cf->cf_path); |
if (cdp->cd_root == NULL) { |
if (cdp->cd_root == NULL) |
cvs_file_freedir(cdp); |
|
return (-1); |
return (-1); |
} |
|
|
|
if (flags & CF_MKADMIN) |
if (flags & CF_MKADMIN) |
cvs_mkadmin(cf, 0755); |
cvs_mkadmin(cf, 0755); |
|
|
if (cdp->cd_repo == NULL) { |
if (cdp->cd_repo == NULL) { |
cvs_log(LP_ERRNO, |
cvs_log(LP_ERRNO, |
"failed to dup repository string"); |
"failed to dup repository string"); |
free(cdp); |
|
return (-1); |
return (-1); |
} |
} |
} |
} |
|
|
fd = open(cf->cf_path, O_RDONLY); |
fd = open(cf->cf_path, O_RDONLY); |
if (fd == -1) { |
if (fd == -1) { |
cvs_log(LP_ERRNO, "failed to open `%s'", cf->cf_path); |
cvs_log(LP_ERRNO, "failed to open `%s'", cf->cf_path); |
cvs_file_freedir(cdp); |
|
return (-1); |
return (-1); |
} |
} |
|
|
|
|
if (ret == -1) { |
if (ret == -1) { |
cvs_log(LP_ERRNO, "failed to get directory entries"); |
cvs_log(LP_ERRNO, "failed to get directory entries"); |
(void)close(fd); |
(void)close(fd); |
cvs_file_freedir(cdp); |
|
return (-1); |
return (-1); |
} |
} |
|
|