summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-14 18:30:53 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-14 18:30:53 +0000
commitae80363d51b26a03acb4edd0484aabd03cc7d948 (patch)
treee106ea088a54d1e4e158d6e3e706371a4219dc3a
parent3eb34887876fa2a83914beb337a09e4638733fee (diff)
make ztcfg able to tolerate tone zones already being loaded and selected as default (or in use by channels) without aborting the configuration process
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3686 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--tonezone.c3
-rw-r--r--ztcfg.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/tonezone.c b/tonezone.c
index 413498f..d470449 100644
--- a/tonezone.c
+++ b/tonezone.c
@@ -369,7 +369,8 @@ int tone_zone_register_zone(int fd, struct tone_zone *z)
x = z->zone;
if ((res = ioctl(fd, ZT_FREEZONE, &x))) {
- fprintf(stderr, "ioctl(ZT_FREEZONE) failed: %s\n", strerror(errno));
+ if (errno != EBUSY)
+ fprintf(stderr, "ioctl(ZT_FREEZONE) failed: %s\n", strerror(errno));
return res;
}
diff --git a/ztcfg.c b/ztcfg.c
index 2cbcb5e..2d94be3 100644
--- a/ztcfg.c
+++ b/ztcfg.c
@@ -1451,7 +1451,8 @@ int main(int argc, char *argv[])
fflush(stdout);
}
if (tone_zone_register(fd, zonestoload[x]))
- error("Unable to register tone zone '%s'\n", zonestoload[x]);
+ if (errno != EBUSY)
+ error("Unable to register tone zone '%s'\n", zonestoload[x]);
}
if (debug & DEBUG_APPLY) {
printf("Doing startup\n");