version 1.9, 2004/12/03 21:08:40 |
version 1.10, 2004/12/06 04:10:06 |
|
|
/* |
/* |
* cvs_resp_removed() |
* cvs_resp_removed() |
* |
* |
* Handler for the `Removed' and `Remove-entry' responses. |
* Handler for the `Removed' and `Remove-entry' responses. The `Removed' |
|
* response is received when both a file and its entry need to be removed from |
|
* the local copy. The `Remove-entry' is received in cases where the file is |
|
* already gone but there is still an entry to remove in the Entries file. |
*/ |
*/ |
|
|
static int |
static int |
|
|
|
|
cvs_splitpath(line, base, sizeof(base), &file); |
cvs_splitpath(line, base, sizeof(base), &file); |
ef = cvs_ent_open(base, O_RDWR); |
ef = cvs_ent_open(base, O_RDWR); |
if (ef == NULL) |
if (ef == NULL) { |
return (-1); |
cvs_log(LP_ERR, "error handling `Removed' response"); |
|
if (type == CVS_RESP_RMENTRY) |
|
return (-1); |
|
} else { |
|
(void)cvs_ent_remove(ef, file); |
|
cvs_ent_close(ef); |
|
} |
|
|
printf("Received a `Remove' on %s\n", line); |
if ((type == CVS_RESP_REMOVED) && (unlink(line) == -1)) { |
cvs_ent_remove(ef, file); |
cvs_log(LP_ERRNO, "failed to unlink `%s'", line); |
cvs_ent_close(ef); |
return (-1); |
|
} |
|
|
return (0); |
return (0); |
} |
} |