From c95a4a86afd477a8d6dc6949e0ce6175a41553d1 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 9 Feb 2012 18:54:26 +0800 Subject: [PATCH] Misc warning killing --- KernelLand/Kernel/drv/vterm.c | 2 +- KernelLand/Modules/IPStack/ipv4.c | 2 +- Usermode/Applications/irc_src/main.c | 25 ++++--------------------- Usermode/Libraries/libnet.so_src/net.h | 2 +- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/KernelLand/Kernel/drv/vterm.c b/KernelLand/Kernel/drv/vterm.c index 71c4d4a8..b5e42d3e 100644 --- a/KernelLand/Kernel/drv/vterm.c +++ b/KernelLand/Kernel/drv/vterm.c @@ -136,7 +136,7 @@ int VT_Install(char **Arguments) if(!gsVT_InputDevice) gsVT_InputDevice = (char*)DEFAULT_INPUT; else if( Module_EnsureLoaded( gsVT_InputDevice ) ) gsVT_InputDevice = (char*)DEFAULT_INPUT; - if( Module_EnsureLoaded( gsVT_OutputDevice ) ) { + if( Module_EnsureLoaded( gsVT_InputDevice ) ) { Log_Error("VTerm", "Fallback input '%s' is not avaliable, input will not be avaliable", DEFAULT_INPUT); } diff --git a/KernelLand/Modules/IPStack/ipv4.c b/KernelLand/Modules/IPStack/ipv4.c index 86301e97..9bafeead 100644 --- a/KernelLand/Modules/IPStack/ipv4.c +++ b/KernelLand/Modules/IPStack/ipv4.c @@ -2,7 +2,7 @@ * Acess2 IP Stack * - IPv4 Protcol Handling */ -#define DEBUG 1 +#define DEBUG 0 #include "ipstack.h" #include "link.h" #include "ipv4.h" diff --git a/Usermode/Applications/irc_src/main.c b/Usermode/Applications/irc_src/main.c index 2bc0ee23..3f46d158 100644 --- a/Usermode/Applications/irc_src/main.c +++ b/Usermode/Applications/irc_src/main.c @@ -706,38 +706,21 @@ int writef(int FD, const char *Format, ...) int OpenTCP(const char *AddressString, short PortNumber) { int fd, addrType; - char *iface; char addrBuffer[8]; // Parse IP Address addrType = Net_ParseAddress(AddressString, addrBuffer); if( addrType == 0 ) { fprintf(stderr, "Unable to parse '%s' as an IP address\n", AddressString); + _SysDebug("Unable to parse '%s' as an IP address\n", AddressString); return -1; } // Finds the interface for the destination address - iface = Net_GetInterface(addrType, addrBuffer); - if( iface == NULL ) { - fprintf(stderr, "Unable to find a route to '%s'\n", AddressString); - return -1; - } - -// printf("iface = '%s'\n", iface); - - // Open client socket - // TODO: Move this out to libnet? - { - int len = snprintf(NULL, 100, "/Devices/ip/%s/tcpc", iface); - char path[len+1]; - snprintf(path, 100, "/Devices/ip/%s/tcpc", iface); - fd = open(path, OPENFLAG_READ|OPENFLAG_WRITE); - } - - free(iface); - + fd = Net_OpenSocket(addrType, addrBuffer, "tcpc"); if( fd == -1 ) { - fprintf(stderr, "Unable to open TCP Client for reading\n"); + fprintf(stderr, "Unable to open TCP Client to '%s'\n", AddressString); + _SysDebug("Unable to open TCP client to '%s'\n", AddressString); return -1; } diff --git a/Usermode/Libraries/libnet.so_src/net.h b/Usermode/Libraries/libnet.so_src/net.h index d02da0bd..7200efe0 100644 --- a/Usermode/Libraries/libnet.so_src/net.h +++ b/Usermode/Libraries/libnet.so_src/net.h @@ -50,7 +50,7 @@ extern char *Net_GetInterface(int AddrType, void *Addr); * If NULL, the node directory is opened * \return Socket file descriptor (as returned by \a open), or -1 on error * - * Opens a file using /Devices/ip/routes/:/ + * Opens a file using /Devices/ip/routes/@:/ * */ extern int Net_OpenSocket(int AddrType, void *Addr, const char *SocketName); -- 2.20.1