From: Super User Date: Sat, 10 May 2008 19:40:23 +0000 (+0200) Subject: fixed some bugs X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=commitdiff_plain;h=4a0bc5037ad69f963cc3da98c0e4cc9d04ae8f1b fixed some bugs modified: dss1.cpp modified: mISDN.cpp --- diff --git a/dss1.cpp b/dss1.cpp index 06b1098..90cd3c5 100644 --- a/dss1.cpp +++ b/dss1.cpp @@ -4054,7 +4054,7 @@ int stack2manager(struct mISDNport *mISDNport, unsigned int cmd, unsigned int pi while(port) { /* are we ISDN ? */ - if (port->p_type == PORT_TYPE_DSS1_NT_IN || port->p_type == PORT_TYPE_DSS1_NT_OUT) + if ((port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_mISDN_DSS1) { pdss1 = (class Pdss1 *)port; /* check out correct stack and id */ diff --git a/mISDN.cpp b/mISDN.cpp index f50abb6..41b2122 100644 --- a/mISDN.cpp +++ b/mISDN.cpp @@ -456,7 +456,7 @@ void ph_control(struct mISDNport *mISDNport, class PmISDN *isdnport, unsigned lo *d++ = c1; *d++ = c2; ret = sendto(sock, buffer, MISDN_HEADER_LEN+sizeof(int)*2, 0, NULL, 0); - if (!ret) + if (ret <= 0) PERROR("Failed to send to socket %d\n", sock); #else void ph_control(struct mISDNport *mISDNport, class PmISDN *isdnport, unsigned long addr, unsigned long c1, unsigned long c2, char *trace_name, int trace_value) @@ -504,7 +504,7 @@ void ph_control_block(struct mISDNport *mISDNport, class PmISDN *isdnport, int s *d++ = c1; memcpy(d, c2, c2_len); ret = sendto(sock, buffer, MISDN_HEADER_LEN+sizeof(int)+c2_len, 0, NULL, 0); - if (!ret) + if (ret <= 0) PERROR("Failed to send to socket %d\n", sock); #else void ph_control_block(struct mISDNport *mISDNport, class PmISDN *isdnport, unsigned long addr, unsigned long c1, void *c2, int c2_len, char *trace_name, int trace_value) @@ -678,7 +678,7 @@ static void _bchannel_activate(struct mISDNport *mISDNport, int i, int activate) act.prim = (activate)?PH_ACTIVATE_REQ:PH_DEACTIVATE_REQ; act.id = 0; ret = sendto(mISDNport->b_socket[i], &act, MISDN_HEADER_LEN, 0, NULL, 0); - if (!ret) + if (ret <= 0) PERROR("Failed to send to socket %d\n", mISDNport->b_socket[i]); #else iframe_t act; @@ -1619,7 +1619,7 @@ int PmISDN::handler(void) frm->prim = PH_DATA_REQ; frm->id = 0; ret = sendto(p_m_mISDNport->b_socket[p_m_b_index], buf, MISDN_HEADER_LEN+ISDN_LOAD-p_m_load-tosend, 0, NULL, 0); - if (!ret) + if (ret <= 0) PERROR("Failed to send to socket %d\n", p_m_mISDNport->b_socket[p_m_b_index]); #else frm->prim = DL_DATA | REQUEST; @@ -3845,7 +3845,7 @@ void PmISDN::txfromup(unsigned char *data, int length) hh->id = 0; memset(buf+MISDN_HEADER_LEN, (options.law=='a')?0x2a:0xff, ISDN_LOAD); ret = sendto(p_m_mISDNport->b_socket[p_m_b_index], buf, MISDN_HEADER_LEN+ISDN_LOAD, 0, NULL, 0); - if (!ret) + if (ret <= 0) PERROR("Failed to send to socket %d\n", p_m_mISDNport->b_socket[p_m_b_index]); #else frm->prim = DL_DATA | REQUEST; @@ -3870,7 +3870,7 @@ void PmISDN::txfromup(unsigned char *data, int length) hh->id = 0; memcpy(buf+MISDN_HEADER_LEN, data, length); ret = sendto(p_m_mISDNport->b_socket[p_m_b_index], buf, MISDN_HEADER_LEN+length, 0, NULL, 0); - if (!ret) + if (ret <= 0) PERROR("Failed to send to socket %d\n", p_m_mISDNport->b_socket[p_m_b_index]); #else frm->prim = DL_DATA | REQUEST;