From e26ea2f072a3702efcd1a3ee93ed58ab049977d5 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Tue, 15 Sep 2009 17:51:15 +0000 Subject: Fix some FreeBSD compatibility issues in -tools Part of issue #15877. Reported by: Max Khon Patches: dahdi-tools.diff uploaded by Max Khon (license 884) git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@7134 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- tonezone.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tonezone.c') diff --git a/tonezone.c b/tonezone.c index 5895851..afdec99 100644 --- a/tonezone.c +++ b/tonezone.c @@ -52,6 +52,10 @@ # define PRINT_DEBUG(x, ...) #endif +#ifndef ENODATA +#define ENODATA EINVAL +#endif + struct tone_zone *tone_zone_find(char *country) { struct tone_zone *z; @@ -431,7 +435,11 @@ int tone_zone_register_zone(int fd, struct tone_zone *z) dump_tone_zone(h, MAX_SIZE - space); #endif +#if defined(__FreeBSD__) + if ((res = ioctl(fd, DAHDI_LOADZONE, &h))) { +#else if ((res = ioctl(fd, DAHDI_LOADZONE, h))) { +#endif fprintf(stderr, "ioctl(DAHDI_LOADZONE) failed: %s\n", strerror(errno)); return res; } -- cgit v1.2.3