summaryrefslogtreecommitdiffstats
path: root/innbbsd/connectsock.c
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-01-30 19:06:47 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-01-30 19:06:47 +0800
commitd570da1aeed86f0b5d51fbc4cf38233a5e661c92 (patch)
tree29e943b44dd18441259162938aa38278fd9e23b5 /innbbsd/connectsock.c
parent4617eab09ea42b678c3d6d18c635a0dda3d6ed5a (diff)
downloadpttbbs-d570da1aeed86f0b5d51fbc4cf38233a5e661c92.tar
pttbbs-d570da1aeed86f0b5d51fbc4cf38233a5e661c92.tar.gz
pttbbs-d570da1aeed86f0b5d51fbc4cf38233a5e661c92.tar.bz2
pttbbs-d570da1aeed86f0b5d51fbc4cf38233a5e661c92.tar.lz
pttbbs-d570da1aeed86f0b5d51fbc4cf38233a5e661c92.tar.xz
pttbbs-d570da1aeed86f0b5d51fbc4cf38233a5e661c92.tar.zst
pttbbs-d570da1aeed86f0b5d51fbc4cf38233a5e661c92.zip
replace unixclient with toconnect
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4432 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd/connectsock.c')
-rw-r--r--innbbsd/connectsock.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/innbbsd/connectsock.c b/innbbsd/connectsock.c
index 8d8cddad..2340eaea 100644
--- a/innbbsd/connectsock.c
+++ b/innbbsd/connectsock.c
@@ -425,41 +425,3 @@ inetclient(server, service, protocol)
return s;
}
-
-int
-unixclient(path, protocol)
- char *path;
- char *protocol;
-{
- struct protoent *pe; /* protocol information entry */
- struct sockaddr_un s_un; /* unix endpoint address */
- int s;
-
- bzero((char *)&s_un, sizeof(s_un));
- s_un.sun_family = AF_UNIX;
-
- if (path == NULL)
- path = DEFAULTPATH;
- if (protocol == NULL)
- protocol = "tcp";
- strcpy(s_un.sun_path, path);
-
- /* map protocol name to protocol number */
- pe = getprotobyname(protocol);
- if (pe == NULL) {
- fprintf(stderr, "%s: Unknown protocol.\n", protocol);
- return (-1);
- }
- /* Allocate a socket */
- s = socket(PF_UNIX, strcmp(protocol, "tcp") ? SOCK_DGRAM : SOCK_STREAM, 0);
- if (s < 0) {
- perror("socket");
- return -1;
- }
- /* Connect the socket to the server */
- if (connect(s, (struct sockaddr *) & s_un, sizeof(s_un)) < 0) {
- /* perror("connect"); */
- return -1;
- }
- return s;
-}