#include "main.h"
#include "myisdn.h"
-extern "C" {
-#define MISDN_OLD_AF_COMPATIBILITY 1
-#include <compat_af_isdn.h>
-}
-#include <q931.h>
+#include <mISDN/mISDNcompat.h>
+int __af_isdn = MISDN_AF_ISDN;
+#include <mISDN/q931.h>
#undef offsetof
#ifdef __compiler_offsetof
{
char filename[256];
- init_af_isdn();
-
/* try to open raw socket to check kernel */
mISDNsocket = socket(PF_ISDN, SOCK_RAW, ISDN_P_BASE);
if (mISDNsocket < 0) {
- fprintf(stderr, "Cannot open mISDN due to '%s'. (Does your Kernel support socket based mISDN?)\n", strerror(errno));
+ fprintf(stderr, "Cannot open mISDN due to '%s'. (Does your Kernel support socket based mISDN? Protocol family is %d.)\n", strerror(errno), PF_ISDN);
return(-1);
}
if (pipe(upqueue_pipe) < 0)
FATAL("Failed to open pipe\n");
- memset(&upqueue_fd, 0, sizeof(upqueue_fd.fd));
+ memset(&upqueue_fd, 0, sizeof(upqueue_fd));
upqueue_fd.fd = upqueue_pipe[0];
register_fd(&upqueue_fd, LCR_FD_READ, mISDN_upqueue, NULL, 0);
struct mbuffer *mb;
struct l3_msg *l3m;
char byte;
+ int ret;
/* unset global semaphore */
upqueue_avail = 0;
// with a very small incident, upqueue_avail may be set by mISDN thread and
// another byte may be sent to the pipe, which causes a call to this function
// again with nothing in the upqueue. this is no problem.
- read(fd->fd, &byte, 1);
+ ret = read(fd->fd, &byte, 1);
/* process all ports */
mISDNport = mISDNport_first;
// this is no problem.
upqueue_avail = 1;
char byte = 0;
- write(upqueue_pipe[1], &byte, 1);
+ int ret;
+ ret = write(upqueue_pipe[1], &byte, 1);
}
return 0;
}