diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-30 20:31:45 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-30 20:31:45 +0000 |
commit | f925e7cf1bd82e7efda5bada9c779e5af6fb539d (patch) | |
tree | bcc48a20e0cc74dfd53f56b95a77754ac643a573 /main/sched.c | |
parent | 858f889967b1c37863ef77c5b14b764914998705 (diff) |
A schedule id of 0 is not possible and is used to flag that we want to add a new item
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81390 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/sched.c')
-rw-r--r-- | main/sched.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/sched.c b/main/sched.c index 602c8516e..f85c0dca4 100644 --- a/main/sched.c +++ b/main/sched.c @@ -209,7 +209,8 @@ static int sched_settime(struct timeval *tv, int when) int ast_sched_replace_variable(int old_id, struct sched_context *con, int when, ast_sched_cb callback, void *data, int variable) { - if (old_id > -1) + /* 0 means the schedule item is new; do not delete */ + if (old_id > 0) ast_sched_del(con, old_id); return ast_sched_add_variable(con, when, callback, data, variable); } |