Created
April 15, 2010 21:23
-
-
Save charles-dyfis-net/367679 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_fd_count() { | |
local fds | |
cd /proc/$$/fd; fds=( * ) # avoid a StackOverflow source colorizer bug | |
echo "${#fds[@]}" | |
} | |
function fd_leak_func() { | |
while : ; do | |
echo ">> Current FDs: $(get_fd_count)" | |
read retval new_state < <(set +e; new_state=$(echo foo); retval=$?; printf "%d %s\n" $retval $new_state) | |
done | |
} | |
fd_leak_func |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment