version 1.5, 2005/05/19 22:07:33 |
version 1.6, 2005/05/20 20:00:53 |
|
|
if (l == -1 || l >= (int)sizeof(cdpath)) { |
if (l == -1 || l >= (int)sizeof(cdpath)) { |
errno = ENAMETOOLONG; |
errno = ENAMETOOLONG; |
cvs_log(LP_ERRNO, "%s", cdpath); |
cvs_log(LP_ERRNO, "%s", cdpath); |
return (-1); |
return (CVS_EX_DATA); |
} |
} |
|
|
if (cdir->cf_type == DT_DIR) { |
if (cdir->cf_type == DT_DIR) { |
|
|
if (chdir(dpath) == -1) { |
if (chdir(dpath) == -1) { |
cvs_log(LP_ERRNO, "cannot change to dir `%s'", |
cvs_log(LP_ERRNO, "cannot change to dir `%s'", |
dpath); |
dpath); |
return (-1); |
return (CVS_EX_FILE); |
} |
} |
|
|
/* construct `cvs update' command */ |
/* construct `cvs update' command */ |
l = snprintf(updcmd, sizeof(updcmd), "%s %s %s update", |
l = snprintf(updcmd, sizeof(updcmd), "%s %s %s update", |
__progname, UPDCMD_FLAGS, root->cr_str); |
__progname, UPDCMD_FLAGS, root->cr_str); |
if (l == -1 || l >= (int)sizeof(updcmd)) |
if (l == -1 || l >= (int)sizeof(updcmd)) |
return (-1); |
return (CVS_EX_DATA); |
|
|
/* XXX we should try to avoid a new connection ... */ |
/* XXX we should try to avoid a new connection ... */ |
if ((fp = popen(updcmd, "r")) == NULL) { |
if ((fp = popen(updcmd, "r")) == NULL) { |
cvs_log(LP_ERROR, "cannot run command `%s'", |
cvs_log(LP_ERROR, "cannot run command `%s'", |
updcmd); |
updcmd); |
return (-1); |
return (CVS_EX_DATA); |
} |
} |
|
|
while (fgets(buf, sizeof(buf), fp) != NULL) { |
while (fgets(buf, sizeof(buf), fp) != NULL) { |
|
|
if (pclose(fp) != 0) { |
if (pclose(fp) != 0) { |
cvs_log(LP_ERROR, "unable to release `%s'", |
cvs_log(LP_ERROR, "unable to release `%s'", |
dpath); |
dpath); |
return (-1); |
return (CVS_EX_DATA); |
} |
} |
|
|
printf("You have [%d] altered file%s in this " |
printf("You have [%d] altered file%s in this " |
|
|
if (chdir(wdir) == -1) { |
if (chdir(wdir) == -1) { |
cvs_log(LP_ERRNO, "cannot change to original " |
cvs_log(LP_ERRNO, "cannot change to original " |
"working dir `%s'", wdir); |
"working dir `%s'", wdir); |
return (-1); |
return (CVS_EX_FILE); |
} |
} |
|
|
if (dflag == 1) { |
if (dflag == 1) { |
|
|
cvs_log(LP_ERRNO, |
cvs_log(LP_ERRNO, |
"deletion of directory `%s' failed", |
"deletion of directory `%s' failed", |
dpath); |
dpath); |
return (-1); |
return (CVS_EX_FILE); |
} |
} |
} |
} |
} |
} |
} else { |
} else { |
cvs_log(LP_ERR, "no such directory: %s", dpath); |
cvs_log(LP_ERR, "no such directory: %s", dpath); |
return (-1); |
return (CVS_EX_DATA); |
} |
} |
|
|
return (0); |
return (0); |