diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-10-17 18:41:24 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-10-17 18:41:24 +0000 |
commit | fb84eff448f5034347d6fab42781dc9fb6b9d91c (patch) | |
tree | 0a96795f184e97bca24b6fd0a98e0210a0353616 /xpp/astribank_is_starting.c | |
parent | a13372d29d628f2f56f2a111f69ef6c1a7bb10c5 (diff) |
astribank_is_starting: use semop if no semtimedop
astribank_is_starting should use a timeout for the semaphore, but if the
GNU-specific semtimedop() is not available, we'll just fall back to using
semop with no time out. Not as good, but better than nothing.
(closes issue #16783)
Reported by: abelbeck
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@9426 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/astribank_is_starting.c')
-rw-r--r-- | xpp/astribank_is_starting.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xpp/astribank_is_starting.c b/xpp/astribank_is_starting.c index 2ae1f73..d7661fe 100644 --- a/xpp/astribank_is_starting.c +++ b/xpp/astribank_is_starting.c @@ -15,6 +15,10 @@ static int debug; static int verbose; static int timeout_seconds = 60; +/* If libc provides no timeout variant: try to do without it: */ +#ifndef HAVE_SEMTIMEDEOP +#define semtimedop(sem, ops, n, timeout) semop(sem, ops, n) +#endif static void usage(void) { |