fixed socket handling
authorSuper User <root@isdn.jolly.ten>
Tue, 17 Jun 2008 10:41:10 +0000 (12:41 +0200)
committerSuper User <root@isdn.jolly.ten>
Tue, 17 Jun 2008 10:41:10 +0000 (12:41 +0200)
modified:   bchannel.c

bchannel.c

index 288d3eb..fafcf1f 100644 (file)
@@ -113,7 +113,7 @@ int bchannel_create(struct bchannel *bchannel, int mode)
        unsigned int on = 1;
        struct sockaddr_mISDN addr;
 
-       if (bchannel->b_sock)
+       if (bchannel->b_sock > -1)
        {
                CERROR(NULL, NULL, "Socket already created for handle 0x%x\n", bchannel->handle);
                return(0);
@@ -589,6 +589,7 @@ struct bchannel *alloc_bchannel(unsigned int handle)
                return(NULL);
        (*bchannelp)->handle = handle;
        (*bchannelp)->b_state = BSTATE_IDLE;
+       (*bchannelp)->b_sock = -1;
                
        return(*bchannelp);
 }