bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] move socket-related client parts into separate file


From: Alexey Mahotkin
Subject: Re: [PATCH] move socket-related client parts into separate file
Date: Wed, 07 May 2003 21:38:51 +0400
User-agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i386-debian-linux)

>>>>> "DRP" == Derek Robert Price <address@hidden> writes:

 DRP> Actually, I'd rather make the whole file not compile at all at the
 DRP> Makefile level when NO_SOCKET_TO_FD is defined.  

No, sorry :)


Move init_sockaddr() to socket-client.[ch], to be used later by
GSSAPI/Kerberos


 src/client.c        |   25 -------------------------
 src/socket-client.c |   27 +++++++++++++++++++++++++++
 src/socket-client.h |    2 ++
 3 files changed, 29 insertions(+), 25 deletions(-)

--- ccvs/src/client.c~socket-client     Wed May  7 21:29:37 2003
+++ ccvs-alexm/src/client.c     Wed May  7 21:30:40 2003
@@ -3112,31 +3112,6 @@ supported_request (name)
 
 
 #if defined (AUTH_CLIENT_SUPPORT) || defined (HAVE_KERBEROS) || defined 
(HAVE_GSSAPI)
-static struct hostent *init_sockaddr PROTO ((struct sockaddr_in *, char *,
-                                            unsigned int));
-
-static struct hostent *
-init_sockaddr (name, hostname, port)
-    struct sockaddr_in *name;
-    char *hostname;
-    unsigned int port;
-{
-    struct hostent *hostinfo;
-    unsigned short shortport = port;
-
-    memset (name, 0, sizeof (*name));
-    name->sin_family = AF_INET;
-    name->sin_port = htons (shortport);
-    hostinfo = gethostbyname (hostname);
-    if (hostinfo == NULL)
-    {
-       fprintf (stderr, "Unknown host %s.\n", hostname);
-       error_exit ();
-    }
-    name->sin_addr = *(struct in_addr *) hostinfo->h_addr;
-    return hostinfo;
-}
-
 
 
 /* Generic function to do port number lookup tasks.
--- ccvs/src/socket-client.c~socket-client      Wed May  7 21:29:37 2003
+++ ccvs-alexm/src/socket-client.c      Wed May  7 21:32:46 2003
@@ -17,6 +17,33 @@
 
 #include "socket-client.h"
 
+
+#if defined (AUTH_CLIENT_SUPPORT) || defined (HAVE_KERBEROS) || defined 
(HAVE_GSSAPI)
+
+struct hostent *
+init_sockaddr (name, hostname, port)
+    struct sockaddr_in *name;
+    char *hostname;
+    unsigned int port;
+{
+    struct hostent *hostinfo;
+    unsigned short shortport = port;
+
+    memset (name, 0, sizeof (*name));
+    name->sin_family = AF_INET;
+    name->sin_port = htons (shortport);
+    hostinfo = gethostbyname (hostname);
+    if (hostinfo == NULL)
+    {
+       fprintf (stderr, "Unknown host %s.\n", hostname);
+       error_exit ();
+    }
+    name->sin_addr = *(struct in_addr *) hostinfo->h_addr;
+    return hostinfo;
+}
+
+#endif
+
 #ifdef NO_SOCKET_TO_FD
 
 /* Under certain circumstances, we must communicate with the server
--- ccvs/src/socket-client.h~socket-client      Wed May  7 21:29:37 2003
+++ ccvs-alexm/src/socket-client.h      Wed May  7 21:31:52 2003
@@ -52,4 +52,6 @@ extern char *strerror ();
 #   endif
 # endif /* ! SOCK_STRERROR */
 
+struct hostent *init_sockaddr PROTO ((struct sockaddr_in *, char *, unsigned 
int));
+
 #endif /* SOCKET_CLIENT_H__ */

_


--alexm




reply via email to

[Prev in Thread] Current Thread [Next in Thread]