Minor hint patch
authorMark Spencer <markster@digium.com>
Tue, 1 Apr 2003 04:03:21 +0000 (04:03 +0000)
committerMark Spencer <markster@digium.com>
Tue, 1 Apr 2003 04:03:21 +0000 (04:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@735 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx.c

diff --git a/pbx.c b/pbx.c
index 718fec5..9a41ce2 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -1336,6 +1336,7 @@ int ast_extension_state_del(int id)
 {
     struct ast_notify *list, *prev = NULL;
     struct ast_notify_cb *cblist, *cbprev;
+    int res = -1;
             
     pthread_mutex_lock(&notifylock);
 
@@ -1366,6 +1367,7 @@ int ast_extension_state_del(int id)
                        list = prev->next;
                    }
                }
+               res = 0;
                break;
            } else {
                cbprev = cblist;                                
@@ -1374,7 +1376,7 @@ int ast_extension_state_del(int id)
        }
 
        // we can have only one item
-       if (cblist)
+       if (cblist || !list)
            break;          
            
        prev = list;
@@ -1382,11 +1384,7 @@ int ast_extension_state_del(int id)
     }
     
     pthread_mutex_unlock(&notifylock);
-    if (list) 
-       return 0;
-    else
-       return -1;
-       
+    return res;
 }
 
 int ast_get_hint(char *hint, int maxlen, struct ast_channel *c, char *context, char *exten)