Skip to contentSkip to conversation

Problem when cancelling connect

Bluez-users jm 1 participant 2 messages Jan 18, 2008 Bluetooth drivers

lore
Share & tools
lore

jm

author
#0 lore raw

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

author
#1 lore raw

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;
}
Quoted 10 lines

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

Quoted 10 lines

-------------------------------------------------------------------------
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/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users