version 1.32, 2004/12/08 05:36:14 |
version 1.33, 2004/12/08 16:07:43 |
|
|
int argc, infd[2], outfd[2], errfd[2]; |
int argc, infd[2], outfd[2], errfd[2]; |
char *argv[16], *cvs_server_cmd, *vresp; |
char *argv[16], *cvs_server_cmd, *vresp; |
|
|
|
|
|
if (root->cr_flags & CVS_ROOT_CONNECTED) { |
|
cvs_log(LP_NOTICE, "already connected to CVSROOT"); |
|
return (0); |
|
} |
|
|
if (pipe(infd) == -1) { |
if (pipe(infd) == -1) { |
cvs_log(LP_ERRNO, |
cvs_log(LP_ERRNO, |
"failed to create input pipe for client connection"); |
"failed to create input pipe for client connection"); |
|
|
|
|
cvs_log(LP_DEBUG, "connected to %s", root->cr_host); |
cvs_log(LP_DEBUG, "connected to %s", root->cr_host); |
|
|
|
root->cr_flags |= CVS_ROOT_CONNECTED; |
|
|
return (0); |
return (0); |
} |
} |
|
|
|
|
void |
void |
cvs_disconnect(struct cvsroot *root) |
cvs_disconnect(struct cvsroot *root) |
{ |
{ |
|
if (!(root->cr_flags & CVS_ROOT_CONNECTED)) |
|
return; |
|
|
cvs_log(LP_DEBUG, "closing connection to %s", root->cr_host); |
cvs_log(LP_DEBUG, "closing connection to %s", root->cr_host); |
if (root->cr_srvin != NULL) { |
if (root->cr_srvin != NULL) { |
(void)fclose(root->cr_srvin); |
(void)fclose(root->cr_srvin); |
|
|
(void)fclose(root->cr_srvout); |
(void)fclose(root->cr_srvout); |
root->cr_srvout = NULL; |
root->cr_srvout = NULL; |
} |
} |
|
|
|
root->cr_flags &= ~CVS_ROOT_CONNECTED; |
} |
} |
|
|
|
|