This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Help me
- To: gcc-help at gcc dot gnu dot org
- Subject: Help me
- From: Pietro <kpietro at inwind dot it>
- Date: Wed, 14 Feb 2001 22:32:50 +0100
Hello ML
I have the program for scan ports, in the which there is :
sin.sin_family=AF_INET;
sin.sin_port=htons(110);
sin.sin_addr.s_addr=htonl(counter);
addr.s_addr=htonl(counter);
bzero(&(sin.sin_zero),
8);
if
(connect(sock, (struct sockaddr*)&sin, sizeof(sin))==0)
{
read(sock, buffer, sizeof(buffer));
if
(strstr(buffer, "QPOP") != NULL)
{
fprintf(stdout, "FOUND : %s\n", inet_ntoa(addr));
}
}
With gcc -g -oprova prova.c is ok!
No error.
When run the program (prova) in the gdb, subsequently line
if (connect(sock, (struct sockaddr*)&sin,
sizeof(sin))==0)
write the command print connect.
The result is :
$1 = {< text variable, no debug info >} 0x400c9ca0
<__libc_connect>
Why ?
The result of connect no egual -1 (error connecting) or 0 (connecting ok)
?
Help me
Thanks
Ciao by italy