summaryrefslogtreecommitdiff
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2012-05-10 18:35:14 +0000
committerJonathan Rose <jrose@digium.com>2012-05-10 18:35:14 +0000
commit8227f70cd70f497cb03c1f9aab63950bcd979d8b (patch)
tree4f4587c0997f7a2d7ad8c6ecc89c3ad2971d5027 /main/asterisk.c
parent3430da58e9f168e608e46133225e0fc81589f6ef (diff)
Coverity Report: Fix issues for error type CHECKED_RETURN for core
(issue ASTERISK-19658) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1905/ ........ Merged revisions 366094 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366106 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index d7fda9588..972c2fbb1 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -1468,7 +1468,11 @@ static int ast_makesocket(void)
ast_log(LOG_WARNING, "Unable to register network verboser?\n");
}
- ast_pthread_create_background(&lthread, NULL, listener, NULL);
+ if (ast_pthread_create_background(&lthread, NULL, listener, NULL)) {
+ ast_log(LOG_WARNING, "Unable to create listener thread.\n");
+ close(ast_socket);
+ return -1;
+ }
if (!ast_strlen_zero(ast_config_AST_CTL_OWNER)) {
struct passwd *pw;
@@ -3345,9 +3349,8 @@ static void *canary_thread(void *unused)
sleep(120);
for (;;) {
- stat(canary_filename, &canary_stat);
now = ast_tvnow();
- if (now.tv_sec > canary_stat.st_mtime + 60) {
+ if (stat(canary_filename, &canary_stat) || now.tv_sec > canary_stat.st_mtime + 60) {
ast_log(LOG_WARNING,
"The canary is no more. He has ceased to be! "
"He's expired and gone to meet his maker! "