diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 8 | ||||
-rw-r--r-- | res/res_calendar.c | 7 | ||||
-rw-r--r-- | res/res_fax.c | 12 | ||||
-rw-r--r-- | res/res_musiconhold.c | 4 |
4 files changed, 10 insertions, 21 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index 1683cb3a1..b1f4736c3 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -1922,7 +1922,7 @@ static int handle_controlstreamfile(struct ast_channel *chan, AGI *agi, int argc static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, const char * const argv[]) { - int res, vres; + int res; struct ast_filestream *fs, *vfs; long sample_offset = 0, max_length; const char *edigits = ""; @@ -1951,7 +1951,7 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, const ast_seekstream(fs, sample_offset, SEEK_SET); res = ast_applystream(chan, fs); if (vfs) - vres = ast_applystream(chan, vfs); + ast_applystream(chan, vfs); ast_playstream(fs); if (vfs) ast_playstream(vfs); @@ -1972,7 +1972,7 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, const /*! \brief get option - really similar to the handle_streamfile, but with a timeout */ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, const char * const argv[]) { - int res, vres; + int res; struct ast_filestream *fs, *vfs; long sample_offset = 0, max_length; int timeout = 0; @@ -2007,7 +2007,7 @@ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, const ast_seekstream(fs, sample_offset, SEEK_SET); res = ast_applystream(chan, fs); if (vfs) - vres = ast_applystream(chan, vfs); + ast_applystream(chan, vfs); ast_playstream(fs); if (vfs) ast_playstream(vfs); diff --git a/res/res_calendar.c b/res/res_calendar.c index 29fc70627..f03a5b8c7 100644 --- a/res/res_calendar.c +++ b/res/res_calendar.c @@ -1706,7 +1706,7 @@ static void *do_refresh(void *data) for (;;) { struct timeval now = ast_tvnow(); struct timespec ts = {0,}; - int res, wait; + int wait; ast_mutex_lock(&refreshlock); @@ -1715,7 +1715,7 @@ static void *do_refresh(void *data) } ts.tv_sec = (now.tv_sec + wait / 1000) + 1; - res = ast_cond_timedwait(&refresh_condition, &refreshlock, &ts); + ast_cond_timedwait(&refresh_condition, &refreshlock, &ts); ast_mutex_unlock(&refreshlock); @@ -1742,10 +1742,9 @@ static int unload_module(void) ao2_callback(calendars, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL); AST_LIST_LOCK(&techs); - AST_LIST_TRAVERSE_SAFE_BEGIN(&techs, tech, list) { + AST_LIST_TRAVERSE(&techs, tech, list) { ast_unload_resource(tech->module, 0); } - AST_LIST_TRAVERSE_SAFE_END; AST_LIST_UNLOCK(&techs); return 0; diff --git a/res/res_fax.c b/res/res_fax.c index ed718aeb6..4126cef5c 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -2266,9 +2266,7 @@ static char *fax_session_tab_complete(struct ast_cli_args *a) } ao2_ref(s, -1); } - if (ao2_iterator_destroy != NULL) { - ao2_iterator_destroy(&i); - } + ao2_iterator_destroy(&i); return name; } @@ -2502,9 +2500,7 @@ static char *cli_fax_show_sessions(struct ast_cli_entry *e, int cmd, struct ast_ ast_log(LOG_ERROR, "error printing filenames for 'fax show sessions' command"); ao2_unlock(s); ao2_ref(s, -1); - if (ao2_iterator_destroy != NULL) { - ao2_iterator_destroy(&i); - } + ao2_iterator_destroy(&i); return CLI_FAILURE; } @@ -2518,9 +2514,7 @@ static char *cli_fax_show_sessions(struct ast_cli_entry *e, int cmd, struct ast_ ao2_unlock(s); ao2_ref(s, -1); } - if (ao2_iterator_destroy != NULL) { - ao2_iterator_destroy(&i); - } + ao2_iterator_destroy(&i); session_count = ao2_container_count(faxregistry.container); ast_cli(a->fd, "\n%d FAX sessions\n\n", session_count); diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index feeabe312..db7f8525c 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -658,13 +658,11 @@ static void *monmp3thread(void *data) } if (class->timer) { struct pollfd pfd = { .fd = ast_timer_fd(class->timer), .events = POLLIN, }; - struct timeval tv; #ifdef SOLARIS thr_yield(); #endif /* Pause some amount of time */ - tv = ast_tvnow(); if (ast_poll(&pfd, 1, -1) > 0) { ast_timer_ack(class->timer, 1); res = 320; @@ -1044,7 +1042,6 @@ static int moh_scan_files(struct mohclass *class) { char filepath[PATH_MAX]; char *ext; struct stat statbuf; - int dirnamelen; int i; if (class->dir[0] != '/') { @@ -1065,7 +1062,6 @@ static int moh_scan_files(struct mohclass *class) { ast_free(class->filearray[i]); class->total_files = 0; - dirnamelen = strlen(dir_path) + 2; if (!getcwd(path, sizeof(path))) { ast_log(LOG_WARNING, "getcwd() failed: %s\n", strerror(errno)); return -1; |