Misc warning killing
[tpg/acess2.git] / Usermode / Applications / irc_src / main.c
index 2bc0ee2..3f46d15 100644 (file)
@@ -706,38 +706,21 @@ int writef(int FD, const char *Format, ...)
 int OpenTCP(const char *AddressString, short PortNumber)\r
 {\r
         int    fd, addrType;\r
-       char    *iface;\r
        char    addrBuffer[8];\r
        \r
        // Parse IP Address\r
        addrType = Net_ParseAddress(AddressString, addrBuffer);\r
        if( addrType == 0 ) {\r
                fprintf(stderr, "Unable to parse '%s' as an IP address\n", AddressString);\r
+               _SysDebug("Unable to parse '%s' as an IP address\n", AddressString);\r
                return -1;\r
        }\r
        \r
        // Finds the interface for the destination address\r
-       iface = Net_GetInterface(addrType, addrBuffer);\r
-       if( iface == NULL ) {\r
-               fprintf(stderr, "Unable to find a route to '%s'\n", AddressString);\r
-               return -1;\r
-       }\r
-       \r
-//     printf("iface = '%s'\n", iface);\r
-       \r
-       // Open client socket\r
-       // TODO: Move this out to libnet?\r
-       {\r
-                int    len = snprintf(NULL, 100, "/Devices/ip/%s/tcpc", iface);\r
-               char    path[len+1];\r
-               snprintf(path, 100, "/Devices/ip/%s/tcpc", iface);\r
-               fd = open(path, OPENFLAG_READ|OPENFLAG_WRITE);\r
-       }\r
-       \r
-       free(iface);\r
-       \r
+       fd = Net_OpenSocket(addrType, addrBuffer, "tcpc");\r
        if( fd == -1 ) {\r
-               fprintf(stderr, "Unable to open TCP Client for reading\n");\r
+               fprintf(stderr, "Unable to open TCP Client to '%s'\n", AddressString);\r
+               _SysDebug("Unable to open TCP client to '%s'\n", AddressString);\r
                return -1;\r
        }\r
        \r

UCC git Repository :: git.ucc.asn.au