diff options
-rw-r--r-- | channels/chan_iax2.c | 2 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_open.c | 2 | ||||
-rw-r--r-- | main/manager.c | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index fd71e3acc..e07858fe1 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -2200,7 +2200,7 @@ static int try_firmware(char *s) return -1; } fwh = (struct ast_iax2_firmware_header*)mmap(NULL, stbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0); - if (fwh == (void *) -1) { + if (fwh == MAP_FAILED) { ast_log(LOG_WARNING, "mmap failed: %s\n", strerror(errno)); close(fd); return -1; diff --git a/main/db1-ast/recno/rec_open.c b/main/db1-ast/recno/rec_open.c index 0ebc8c7c4..0fb08258c 100644 --- a/main/db1-ast/recno/rec_open.c +++ b/main/db1-ast/recno/rec_open.c @@ -169,7 +169,7 @@ slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL) t->bt_msize = sb.st_size; if ((t->bt_smap = mmap(NULL, t->bt_msize, PROT_READ, MAP_PRIVATE, rfd, - (off_t)0)) == (caddr_t)-1) + (off_t)0)) == MAP_FAILED goto slow; t->bt_cmap = t->bt_smap; t->bt_emap = t->bt_smap + sb.st_size; diff --git a/main/manager.c b/main/manager.c index 0e4c26a58..8d5511669 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3921,7 +3921,9 @@ static struct ast_str *generic_http_callback(enum output_format format, size_t l = ftell(s.f); if (l) { - if ((buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_SHARED, s.fd, 0))) { + if (MAP_FAILED == (buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_PRIVATE, s.fd, 0))) { + ast_log(LOG_WARNING, "mmap failed. Manager output was not processed\n"); + } else { if (format == FORMAT_XML || format == FORMAT_HTML) xml_translate(&out, buf, params, format); else |