2007-12-14 00:14:42 +01:00
|
|
|
--- iaxmodem.c.orig 2007-10-06 12:22:04.000000000 -0400
|
|
|
|
+++ iaxmodem.c 2007-11-06 23:54:40.000000000 -0500
|
|
|
|
@@ -21,17 +21,18 @@
|
2006-08-21 06:30:49 +02:00
|
|
|
#include <string.h>
|
2007-12-14 00:14:42 +01:00
|
|
|
#include <strings.h>
|
|
|
|
|
2006-08-21 06:30:49 +02:00
|
|
|
-#ifndef __OpenBSD__
|
|
|
|
+#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
|
2007-12-14 00:14:42 +01:00
|
|
|
# ifndef USE_UNIX98_PTY
|
|
|
|
# include <pty.h>
|
|
|
|
# endif /* !USE_UNIX98_PTY */
|
2006-08-21 06:30:49 +02:00
|
|
|
#else
|
2007-12-14 00:14:42 +01:00
|
|
|
+#include <termios.h>
|
2006-08-21 06:30:49 +02:00
|
|
|
+#if !defined(__FreeBSD__)
|
2007-12-14 00:14:42 +01:00
|
|
|
# include <util.h>
|
2006-08-21 06:30:49 +02:00
|
|
|
#endif
|
|
|
|
+#endif
|
2007-12-14 00:14:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
-#include <termios.h>
|
|
|
|
-
|
2006-08-21 06:30:49 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <dirent.h>
|
2007-12-14 00:14:42 +01:00
|
|
|
@@ -53,6 +54,26 @@
|
2006-08-21 06:30:49 +02:00
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
+
|
|
|
|
+#ifdef __FreeBSD__
|
|
|
|
+#include <libutil.h>
|
2007-12-14 00:14:42 +01:00
|
|
|
+char* strndup(const char* string, size_t n)
|
|
|
|
+{
|
|
|
|
+ char* copy_string = 0;
|
|
|
|
+
|
|
|
|
+ if(0 == string || 0 == n)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ copy_string = (char*) malloc(n + 1);
|
|
|
|
+ if(0 == copy_string)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ memcpy(copy_string, string, n);
|
|
|
|
+ *(copy_string + n) = '\0';
|
|
|
|
+
|
|
|
|
+ return copy_string;
|
|
|
|
+}
|
2006-08-21 06:30:49 +02:00
|
|
|
+#endif
|
|
|
|
#include <tiffio.h>
|
|
|
|
|
2007-12-14 00:14:42 +01:00
|
|
|
#ifndef O_LARGEFILE
|
2013-05-19 01:09:58 +02:00
|
|
|
@@ -1645,8 +1666,6 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- closedir(cfdir);
|
|
|
|
-
|
|
|
|
if (pid == 0) {
|
|
|
|
/* Start the modem */
|
|
|
|
iaxmodem(config, 0);
|
|
|
|
@@ -1654,6 +1673,8 @@
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ closedir(cfdir);
|
|
|
|
+
|
|
|
|
return 0;
|
|
|
|
}
|