diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-02 17:30:11 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-02 17:30:11 +0000 |
commit | c9672ef9589851a57b61eb897002b7786e8a17d4 (patch) | |
tree | 02f352b1883eea60cf2850da2a55cb9fc65ea4fa | |
parent | 82f23a43e68a9864d181690e715d7a3ec418e9e9 (diff) |
* add the appropriate preprocessor wrappers to compile only the code
required for each program
* make cvs_sock_connect() take a full path to the socket
-rw-r--r-- | usr.bin/cvs/sock.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/cvs/sock.c b/usr.bin/cvs/sock.c index 5e1cc9cf74f..923faf27c24 100644 --- a/usr.bin/cvs/sock.c +++ b/usr.bin/cvs/sock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sock.c,v 1.2 2004/07/25 03:31:24 jfb Exp $ */ +/* $OpenBSD: sock.c,v 1.3 2004/08/02 17:30:10 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -57,6 +57,7 @@ static int cvs_sock = -1; static struct sockaddr_un cvs_sun; +#ifdef CVSD /* * cvsd_sock_open() * @@ -149,8 +150,9 @@ cvsd_sock_accept(int fd) return (0); } +#endif - +#ifdef CVS /* * cvs_sock_connect() * @@ -158,11 +160,10 @@ cvsd_sock_accept(int fd) */ int -cvs_sock_connect(const char *cvsroot) +cvs_sock_connect(const char *path) { cvs_sun.sun_family = AF_LOCAL; - snprintf(cvs_sun.sun_path, sizeof(cvs_sun.sun_path), "%s/%s", - cvsroot, CVSD_SOCK_PATH); + strlcpy(cvs_sun.sun_path, path, sizeof(cvs_sun.sun_path)); cvs_log(LP_INFO, "connecting to CVS server socket `%s'", cvs_sun.sun_path); @@ -197,3 +198,4 @@ cvs_sock_disconnect(void) if (close(cvs_sock) == -1) cvs_log(LP_ERRNO, "failed to close local socket"); } +#endif |