From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41822 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pzz84-0003nz-T5 for qemu-devel@nongnu.org; Wed, 16 Mar 2011 18:23:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pzz83-0005Nb-Nt for qemu-devel@nongnu.org; Wed, 16 Mar 2011 18:23:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pzz83-0005NM-F4 for qemu-devel@nongnu.org; Wed, 16 Mar 2011 18:23:43 -0400 From: Juan Quintela In-Reply-To: (Peter Maydell's message of "Wed, 16 Mar 2011 21:30:54 +0000") References: <4f8db30e533a8d9cd877a6fb56794ab0c35d1e1f.1300297944.git.quintela@redhat.com> Date: Wed, 16 Mar 2011 23:22:01 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH 2/2] net/socket: allow ipv6 for net_socket_listen_init and net_socket_connect_init Reply-To: quintela@redhat.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org Peter Maydell wrote: > On 16 March 2011 21:01, Juan Quintela wrote: >> - =C2=A0 =C2=A0ret =3D bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)= ); >> + =C2=A0 =C2=A0ret =3D tcp_server_start(host_str, &fd); >> =C2=A0 =C2=A0 if (ret < 0) { >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0perror("bind"); >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0perror("tcp_server_start"); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -1; >> =C2=A0 =C2=A0 } > > It looks like tcp_server_start() returns an error code > rather than setting errno, so isn't perror() wrong here? You are right O:-) I am not clear about what to do here. Basically we have: - migration code: uses DPRINTF() - sockets: use perror() left and right. Any good idea on what to do everywhere? For this case, I will just put strerrno(), easy enough. Thanks a lot, Juan.