rapid7/metasploit-framework — pull request #584 by mephos (2012-07-09 20:04:32+00:00)
Title: Various meterpreter bugfixes

reap zombie thread with 2.4 kernels / fix compilation / permit cat empty file

with 2.4 kernels (before NPTL threads), a thread was actually a process (could appear with ps and in /proc)
and sometimes, they were not reaped when using pthread_join
(stayed zombie in the system and consumed resources)
Now, create a thread that will reap them using waitpid and __WCLONE
Cause no problem on 2.6 kernels

fix a compilation problem on sniffer extension on linux meterpreter

enable stdapi_net_socket_tcp_shutdown for linux meterpreter too

permit to cat empty files without making meterpreter exit (was en EOFError exception not caught)
see http://dev.metasploit.com/redmine/issues/7042