diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-09-15 17:51:15 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-09-15 17:51:15 +0000 |
commit | e26ea2f072a3702efcd1a3ee93ed58ab049977d5 (patch) | |
tree | 991159b62e5a8f16d98b924836fe0c1a8d4bbccb /tonezone.c | |
parent | 60944d31be167a244e5670d36f5963c55b43681c (diff) |
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
Diffstat (limited to 'tonezone.c')
-rw-r--r-- | tonezone.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; } |