version 1.13, 2005/04/25 16:29:41 |
version 1.14, 2005/05/20 20:00:53 |
|
|
int |
int |
cvs_import_file(CVSFILE *cfp, void *arg) |
cvs_import_file(CVSFILE *cfp, void *arg) |
{ |
{ |
int ret, l; |
int l; |
struct cvsroot *root; |
struct cvsroot *root; |
char fpath[MAXPATHLEN], repodir[MAXPATHLEN]; |
char fpath[MAXPATHLEN], repodir[MAXPATHLEN]; |
char repo[MAXPATHLEN]; |
char repo[MAXPATHLEN]; |
|
|
if (l == -1 || l >= (int)sizeof(repo)) { |
if (l == -1 || l >= (int)sizeof(repo)) { |
errno = ENAMETOOLONG; |
errno = ENAMETOOLONG; |
cvs_log(LP_ERRNO, "%s", repo); |
cvs_log(LP_ERRNO, "%s", repo); |
return (-1); |
return (CVS_EX_DATA); |
} |
} |
|
|
cvs_file_getpath(cfp, fpath, sizeof(fpath)); |
cvs_file_getpath(cfp, fpath, sizeof(fpath)); |
|
|
if (l == -1 || l >= (int)sizeof(repodir)) { |
if (l == -1 || l >= (int)sizeof(repodir)) { |
errno = ENAMETOOLONG; |
errno = ENAMETOOLONG; |
cvs_log(LP_ERRNO, "%s", repodir); |
cvs_log(LP_ERRNO, "%s", repodir); |
return (-1); |
return (CVS_EX_DATA); |
} |
} |
} |
} |
if (root->cr_method != CVS_METHOD_LOCAL) { |
if (root->cr_method != CVS_METHOD_LOCAL) { |
ret = cvs_sendreq(root, CVS_REQ_DIRECTORY, fpath); |
if (cvs_sendreq(root, CVS_REQ_DIRECTORY, fpath) < 0) |
if (ret == 0) |
return (CVS_EX_PROTO); |
ret = cvs_sendln(root, repodir); |
if (cvs_sendln(root, repodir) < 0) |
|
return (CVS_EX_PROTO); |
} else { |
} else { |
/* create the directory */ |
/* create the directory */ |
} |
} |