quick fix for #1055: make sure our mmap fd is > 2

pull/1057/head
Isaac Connor 2015-09-16 09:11:22 -04:00
parent d3dc214d90
commit 0571ca3025
1 changed files with 6 additions and 0 deletions

View File

@ -116,6 +116,12 @@ bool Monitor::MonitorLink::connect()
disconnect(); disconnect();
return( false ); return( false );
} }
while ( map_fd <= 2 ) {
int new_map_fd = dup(map_fd);
Warning( "Got one of the stdio fds for our mmap handle. map_fd was %d, new one is %d", map_fd, new_map_fd );
close(map_fd);
map_fd = new_map_fd;
}
struct stat map_stat; struct stat map_stat;
if ( fstat( map_fd, &map_stat ) < 0 ) if ( fstat( map_fd, &map_stat ) < 0 )