Re: Problem when cancelling connect

jm <[email protected]>
Newsgroups gmane.linux.bluez.user
Message-ID <[email protected]>
I forgot to mention I cancel the call to connect() using siglongjmp:

sigjmp_buf jmpbuf;

int sig_handler(int signo)
{
    siglongjmp (jmpbuf, 1);
}

...

signal (SIGALRM, sig_handler);

alarm( MAX_CONNECT_TIME );

if (!sigsetjmp(jmpbuf, 1)){
    BtOBEX_TransportConnect(handle, BDADDR_ANY, &bdaddr, channel)
    alarm(0);  
    ...
}
else{
    signal (SIGALRM, SIG_DFL);
    return -1;
}
> Hi all!
>
> I'm trying to cancel a call to connect() (The one called by 
> BtOBEX_TransportConnect) using a SIGALRM signal. It works fine, but a 
> random subsequent call to hci_inquiry() or sdp_connect() causes a 
> segmentation fault. I've tried to restore the default signal handler and 
> closing the socket by hand, with no luck. Any idea about what is going on?
>
> Thanks in advance
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.