X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Flpp%2Flpp_net.c;h=7ef72858fb3ba615699269d84e5ca07887127b3d;hb=a147197e0d20514db14cd60a2e876bcdd6c05f66;hp=f0ae59af9638ac9b33897f6af46cb52223602a2e;hpb=4cc881755b5280cd5a3649ecb8d7c8fe197a7fc9;p=libfirm diff --git a/ir/lpp/lpp_net.c b/ir/lpp/lpp_net.c index f0ae59af9..7ef72858f 100644 --- a/ir/lpp/lpp_net.c +++ b/ir/lpp/lpp_net.c @@ -1,13 +1,28 @@ -/** - * @file lpp_net.c - * @date 19.07.2005 - * @author Sebastian Hack +/* + * Copyright (C) 2005-2011 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. * - * A client for an lpp solving server. + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. * - * Copyright (C) 2005 Universitaet Karlsruhe - * Released under the GPL + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +/** + * @file + * @brief A client for an lpp solving server. + * @author Sebastian Hack */ +#include "config.h" #ifdef _WIN32 #include @@ -44,6 +59,7 @@ #include "lpp_net.h" #include "lpp_t.h" #include "lpp_comm.h" +#include "xmalloc.h" #ifdef _WIN32 static int winsock_init(void) @@ -94,7 +110,7 @@ static int connect_tcp(const char *host, uint16_t port) sin.sin_port = htons(port); if ((phe = gethostbyname(host))) - memcpy(&sin.sin_addr, phe->h_addr, phe->h_length); + memcpy(&sin.sin_addr, phe->h_addr_list[0], phe->h_length); else if((sin.sin_addr.s_addr = inet_addr(host)) == INADDR_NONE) { lpp_print_err("cannot get host entry for %s", host); return -1; @@ -121,7 +137,7 @@ char **lpp_get_solvers(const char *host) lpp_writel(comm, LPP_CMD_SOLVERS); lpp_flush(comm); n = lpp_readl(comm); - res = malloc((n + 1) * sizeof(res[0])); + res = XMALLOCN(char*, n+1); res[n] = NULL; if(n > 0) {