Merged revisions 189419 via svnmerge from

https://origsvn.digium.com/svn/asterisk/trunk

................
  r189419 | dbailey | 2009-04-20 14:28:16 -0500 (Mon, 20 Apr 2009) | 11 lines
  
  Merged revisions 189391 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r189391 | dbailey | 2009-04-20 14:10:56 -0500 (Mon, 20 Apr 2009) | 4 lines
    
    Clean up problem with manager implementation of mmap where it was not testing against MAP_FAILED response.
    Got rid of shadowed variable used in processign the mmap results. 
    Change test of mmap results to compare against MAP_FAILED
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@189422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Doug Bailey
2009-04-20 19:47:43 +00:00
parent 5528fffeb3
commit 2b41886194
3 changed files with 5 additions and 3 deletions

View File

@@ -3891,7 +3891,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