=== removed file 'zsh-functions/zsv_check_fdcount' --- zsh-functions/zsv_check_fdcount 2014-07-22 23:44:08 +0000 +++ zsh-functions/zsv_check_fdcount 1970-01-01 00:00:00 +0000 @@ -1,7 +0,0 @@ -local pid count fdtype -pid=$(<$zsv_dir/supervise/pid) || return $? -for count fdtype in "$@"; do - (( $count >= zsv_fd_counts[${fdtype:-socket}] )) || return $? -done -return 0 -# vim: ft=zsh noet ts=4 sts=4 sw=4 === removed file 'zsh-functions/zsv_fdcount' --- zsh-functions/zsv_fdcount 2014-07-22 23:44:08 +0000 +++ zsh-functions/zsv_fdcount 1970-01-01 00:00:00 +0000 @@ -1,39 +0,0 @@ -zmodload zsh/stat - -typeset -gA zsv_fd_counts -local -A ftypes seen -local key fdlink fddest - -zsv_fd_counts=( ) - -ftypes=( # convert hex type to a word - C socket - c socket - A link - a link - 8 file - 6 block - 4 dir - 2 char - 1 pipe -) - -for fdlink in "$@"; do - fddest=$(zstat -L +link $fdlink) || continue - (( $+seen[$fddest] )) && continue - case $fddest in - (/dev/null) inc null;; - (/*) - zstat -H s $fdlink || continue - ftype=$(( [##16] $s[mode] >> 12 )) - key=$ftypes[$ftype] - zsv_fd_counts[$key]=$(( $zsv_fd_counts[$key] + 1 )) - ;; - (*) - key=${fddest%%:*} - zsv_fd_counts[$key]=$(( $zsv_fd_counts[$key] + 1 )) - ;; - esac - seen[$fddest]=1 -done -# vim: fileencoding=utf-8 ft=zsh noet sw=4 ts=4 sts=4